我正在运行一个创建文件夹 dist
的作业,以及另一个作业,该作业依赖于第一个作业成功完成来上传 dist
文件夹。但是,我在上传时遇到错误,说该目录不存在,而它可以在本地创建文件夹并将其推送到 github。我不想将文件夹推送到我的存储库,有办法吗?
name: Build Artifcats and Upload To Azure Blob Storage
on:
push:
branches:
- main
jobs:
build_on_win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@master
with:
node-version: 14.2.0
Running Scripts**.........
upload:
runs-on: ubuntu-latest
needs: build_on_win (Notice here I'm waiting for the artifacts to be built)
steps:
- uses: actions/checkout@v2
- uses: bacongobbler/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="dcbda6a9aeb9f1beb0b3bef1afa8b3aebdbbb9f1a9acb0b3bdb89caaedf2eef2ec" rel="noreferrer noopener nofollow">[email protected]</a>
with:
source_dir: ./solutions/app/dist
container_name: 'app/latest'
connection_string: .......
sync: true
最佳答案
文件夹(和文件)不在作业之间共享。
要实现您想要的目标,您需要将 dist
目录作为工件上传(使用upload action,然后在第二个作业中使用download action 在对第二个作业执行您想要的操作之前。
您可以在 GHA official documentation 上找到更多信息.
关于github-actions - 使用 github actions 创建文件夹并将其上传到目的地,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70499794/