Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow upload artifact to overwrite an existing artifact #220

Merged
merged 4 commits into from
Feb 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 37 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,44 @@ jobs:
key: Blueprint-cache
continue-on-error: true

- name: Upload docs & blueprint artifact
uses: actions/upload-pages-artifact@v3
## cannot use upload-pages-artifact@v3 twice (it is used for the blueprint above)
## it fails because two identically named artifacts are uploaded
## (for github pages deployment to work, the artifact must be named 'github-pages')
## This could be fixed using upload-artifact's 'overwrite:true' option, but it is not implemented on upload-pages-artifact
## Copied the archive/upload action from upload-pages-artifact below.
## This should be replaced with
## - name: Upload docs & blueprint artifact
## uses: actions/upload-pages-artifact@v3
## with:
## path: docs
## name: github-pages
## overwrite: true
## when this is supported
- name: Archive artifact
shell: sh
run: |
echo ::group::Archive artifact
tar \
--dereference --hard-dereference \
--directory "$INPUT_PATH" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
--exclude=".[^/]*" \
.
echo ::endgroup::
env:
INPUT_PATH: docs

- name: Upload artifact
id: upload-artifact
uses: actions/upload-artifact@v4
with:
path: docs
name: github-pages
path: ${{ runner.temp }}/artifact.tar
retention-days: 1
if-no-files-found: error
overwrite: true

- name: Deploy to GitHub Pages
id: deployment
Expand Down