gpt4 book ai didi

github-actions - 如何在另一个工作流程中下载工件/发布 Assets

转载 作者:行者123 更新时间:2023-12-04 12:09:49 31 4
gpt4 key购买 nike

Github 操作是否可以为发布分支上的提交上传构建工件,然后让另一个工作流下载和使用该工件?

name: Deploy release to UAT & archive artifact
on:
release:
types: [published]
jobs:
package:
name: package and archive
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12'
- name: serverless package
uses: serverless/github-action@master
with:
args: package --stage=prod
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: .serverless
asset_name: release-asset-${{ github.event.release.name }}.zip
asset_content_type: application/zip
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: release-artifact-${{ github.event.release.name }}
path: .serverless

...但是你如何下载 Assets /工件?我想 up/download-artifact仅用于同一工作流程,并且似乎没有下载发布 Assets 的操作。
name: Deploy to production
on:
workflow_dispatch:
inputs:
release:
description: Name of release to deploy
required: true
default: v1.0.0

jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12'
- run: npm ci --only=prod
- name: Download the release artifact
uses: actions/download-artifact@v2
with:
name: release-${{ github.event.inputs.release }}
path: .serverless
- name: serverless deploy
uses: serverless/github-action@master
with:
args: deploy --stage=prod --package=.serverless
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

最佳答案

关于github-actions - 如何在另一个工作流程中下载工件/发布 Assets ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64868918/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com