QuickStart
正文
新建.github/workflows 和 .github/workflows/github-actions-demo.yml
You can give the workflow file any name you like, but you must use .yml or .yaml as the file name extension. YAML is a markup language that's commonly used for configuration files.
可用yaml template
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@v6
- 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 }}."
Viewing your workflow results
-
On GitHub, navigate to the main page of the repository.
-
Under your repository name, click Actions.

-
In the left sidebar, click the workflow you want to display, in this example "GitHub Actions Demo."

-
From the list of workflow runs, click the name of the run you want to see, in this example "USERNAME is testing out GitHub Actions."
-
In the left sidebar of the workflow run page, under Jobs, click the Explore-GitHub-Actions job.

-
The log shows you how each of the steps was processed. Expand any of the steps to view its details.

For example, you can see the list of files in your repository:
