第一步:
第二步:
第三步:
左边红色框中的是你新建actions脚本的路径和名字,根目录就是你的项目根目录
点击右边的start commit 按钮完成创建
第四步:
点击commit new file按钮 完成创建 你就可以在你的项目中看到main.yml这个配置文件了
第五步:
重点1:- uses: actions/checkout@v2 这个是必须要使用的,拷贝你的代码
这样做了以后,那么脚本你可以自行决定 shell js皆可
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
# pull_request:
# branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world!
# Runs a set of commands using the runners shell
- name: Run a multi-line script
shell: bash
run: |
sh pulish001.sh
脚本路径