gitea-action-test/.github/workflows/zzz.yml
LIRUI 0baa1e2984
All checks were successful
test / checkout_and_upload (push) Successful in 15s
test / download_and_use (push) Successful in 3s
1028
2024-10-28 12:01:43 +08:00

38 lines
1.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: test
on:
push:
branches:
- main
jobs:
# 第一个 Job检出代码并上传
checkout_and_upload:
runs-on: ubuntu-latest
steps:
- name: 🛒 检出代码
#uses: actions/checkout@v3
#uses: https://git.aoun.ltd/18152827937/checkout@v4
uses: https://gitea.com/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 # 确认文件是否已成功下载
# 这里可以继续使用检出的代码进行构建或其他操作