Skip to content

Commit

Permalink
Merge pull request #4009 from zowe/chore/update-deploy-workflow
Browse files Browse the repository at this point in the history
Update workflows to use latest versions of actions
  • Loading branch information
t1m0thyj authored Nov 19, 2024
2 parents 54cff7c + 59b8599 commit 5bad8db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ jobs:
# https://github.com/actions/checkout/issues/520#issuecomment-1320838255
fetch-depth: 2147483647

- name: Use Node.js LTS
uses: actions/setup-node@v3
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: 'npm'

- name: Cache Webpack Build
uses: actions/cache@v3
uses: actions/cache@v4
env:
TAR_OPTIONS: "--remove-files"
with:
Expand All @@ -59,7 +59,7 @@ jobs:
- name: Deploy to Netlify
id: deploy
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
uses: nwtgck/actions-netlify@v2
uses: nwtgck/actions-netlify@v3
with:
publish-dir: build
production-branch: master
Expand All @@ -74,13 +74,11 @@ jobs:

- name: Compress Build Archive
if: ${{ steps.deploy.conclusion == 'skipped' }}
run: |
echo "PR_NUMBER=${{ github.event.pull_request.number }}" > build/.env
tar --remove-files --zstd -cf build.tar.zst build
run: tar --label=${{ github.event.pull_request.number }} --remove-files --zstd -cf build.tar.zst build

- name: Upload Build Artifact
if: ${{ steps.deploy.conclusion == 'skipped' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: preview-build
path: build.tar.zst
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- name: Download Build Artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-docs.yml
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -29,13 +29,14 @@ jobs:
- name: Extract Build Archive
if: ${{ steps.download-artifact.outputs.found_artifact == 'true' }}
run: |
tar -xf build.tar.zst && rm build.tar.zst
cat build/.env >> "$GITHUB_ENV" && rm build/.env
tar -xf build.tar.zst
printf "PR_NUMBER=%d\n" "$(tar --test-label -f build.tar.zst)" >> "$GITHUB_ENV"
rm build.tar.zst
- name: Deploy to Netlify
id: deploy
if: ${{ steps.download-artifact.outputs.found_artifact == 'true' }}
uses: nwtgck/actions-netlify@v2
uses: nwtgck/actions-netlify@v3
with:
publish-dir: build
production-deploy: false
Expand Down

0 comments on commit 5bad8db

Please sign in to comment.