Skip to content

Commit

Permalink
Use upload and download v4
Browse files Browse the repository at this point in the history
  • Loading branch information
recrwplay committed Jan 18, 2024
1 parent eec5ad3 commit 13d6e36
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/docs-deploy-surge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jobs:

runs-on: ubuntu-latest

# with download-artifact v4 we need to use a matrix to get HTML and changelog artifacts
# because the artifacts will have been uploaded separately to ensure unique names
strategy:
matrix:
required-artifacts: ["docs", "changelog"]

steps:
- name: "Download built documentation"
uses: actions/[email protected]
Expand All @@ -35,7 +41,7 @@ jobs:
run_id: ${{ env.RUN_ID }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "docs"
return artifact.name == "${{ matrix.required-artifacts }}}"
})[0];
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
Expand All @@ -44,9 +50,9 @@ jobs:
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{ env.WORKSPACE }}/docs.zip', Buffer.from(download.data));
fs.writeFileSync('${{ env.WORKSPACE }}/${{ matrix.required-artifacts }}.zip', Buffer.from(download.data));
- run: unzip docs.zip
- run: unzip ${{ matrix.required-artifacts }}.zip

- id: get-deploy-id
run: |
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/reusable-docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,22 @@ jobs:
run: echo $DEPLOY_ID > ./build/deployid

- name: Upload HTML artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docs
path: build/
retention-days: ${{ inputs.retain-artifacts }}

- name: Upload Log artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: antora-log
path: build/log
retention-days: ${{ inputs.retain-artifacts }}

- name: Upload Page List artifact
id: page-list-artifact
if: ${{ inputs.pageList }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: page-list
path: build/site/.meta/pageList
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-docs-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
# upload artifacts

- name: Save log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linklog
path: link-log.txt
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/reusable-docs-pr-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ jobs:
writeFileSync(`${WORKSPACE}/changelog`, Buffer.from(comment));
# For upload-artifact v4 we need to provide a unique artifact name
- name: Upload changelog
if: ${{ hashFiles('changelog') != '' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: changelog
path: changelog

0 comments on commit 13d6e36

Please sign in to comment.