36 lines
1005 B
YAML
36 lines
1005 B
YAML
name: test
|
||
|
||
on:
|
||
# push:
|
||
# branches:
|
||
# - main
|
||
|
||
jobs:
|
||
# 第一个 Job:检出代码并上传
|
||
checkout_and_upload:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- name: 🛒 检出代码
|
||
uses: https://git.aoun.ltd/actions/checkout@v4
|
||
|
||
- name: 📦 上传代码作为工件
|
||
uses: actions/upload-artifact@v3
|
||
with:
|
||
name: source-code # 工件名称
|
||
path: . # 上传当前目录的所有内容
|
||
|
||
# 第二个 Job:下载工件并使用代码
|
||
download_and_use:
|
||
runs-on: ubuntu-latest
|
||
needs: checkout_and_upload # 确保在第一个 Job 完成后再运行
|
||
steps:
|
||
- name: 📥 下载代码工件
|
||
uses: actions/download-artifact@v3
|
||
with:
|
||
name: source-code # 下载第一个 Job 中的工件
|
||
|
||
- name: 🔍 使用下载的代码
|
||
run: |
|
||
ls -la # 确认文件是否已成功下载
|
||
# 这里可以继续使用检出的代码进行构建或其他操作
|