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

Update workflows to use latest versions of actions #4009

Merged
merged 4 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
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
echo "PR_NUMBER=$(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
Loading