Github Actions

GitHub Actions 操作快速入门

您只需要一个 GitHub 存储库即可创建和运行 GitHub Actions 工作流。在本指南中,您将添加一个工作流程来演示 GitHub Actions 的一些基本功能。

以下示例向您展示了 GitHub Actions 作业如何自动触发、它们在何处运行以及它们如何与存储库中的代码交互。

创建您的第一个工作流程.

https://docs.github.com/en/actions/quickstart

  1. .github/workflows如果此目录尚不存在,请在 GitHub 上的存储库中创建一个目录。
  2. 在该.github/workflows目录中,创建一个名为github-actions-demo.yml. 有关详细信息,请参阅“创建新文件打开新窗口”。
  3. 将以下 YAML 内容复制到github-actions-demo.yml文件中:
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
  Explore-GitHub-Actions:
    runs-on: ubuntu-latest
    steps:
      - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
      - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
      - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
      - name: Check out repository code
        uses: actions/checkout@v3
      - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
      - run: echo "🖥️ The workflow is now ready to test your code on the runner."
      - name: List files in the repository
        run: |
          ls ${{ github.workspace }}
      - run: echo "🍏 This job's status is ${{ job.status }}."

资料

https://docs.github.com/zh/actions/guides

https://github.com/sdras/awesome-actions

https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions

https://learn.microsoft.com/en-us/training/paths/automate-workflow-github-actions/

https://codefresh.io/learn/github-actions/github-actions-tutorial-and-examples/

更新时间: