ci(deps): update actions to latest versions

fix: ensure bootstrap script catches CI env
This commit is contained in:
Marc 2024-02-16 00:14:30 -05:00
parent 3479a85fa0
commit 27443a1174
Signed by: marc
GPG key ID: 048E042F22B5DC79
2 changed files with 25 additions and 33 deletions

View file

@ -6,19 +6,18 @@ on:
env: env:
NODE_VERSION: 20 NODE_VERSION: 20
CI: 1
jobs: jobs:
setup: setup:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Setup name: Setup
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/setup-node@v3 - uses: actions/setup-node@v4
id: node-setup id: node-setup
with: with:
node-version: ${{ env.NODE_VERSION }} node-version: ${{ env.NODE_VERSION }}
- uses: actions/cache@v3 - uses: actions/cache@v4
id: cache-restore id: cache-restore
with: with:
path: | path: |
@ -26,19 +25,19 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }} key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
- name: Install dependencies - name: Install dependencies
if: steps.cache-restore.outputs.cache-hit != 'true' if: steps.cache-restore.outputs.cache-hit != 'true'
run: . script/bootstrap run: . script/bootstrap.sh
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Lint name: Lint
needs: setup needs: setup
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/setup-node@v3 - uses: actions/setup-node@v4
id: node-setup id: node-setup
with: with:
node-version: ${{ env.NODE_VERSION }} node-version: ${{ env.NODE_VERSION }}
- name: Yarn cache - name: Yarn cache
uses: actions/cache@v3 uses: actions/cache@v4
id: yarn-cache-restore id: yarn-cache-restore
with: with:
path: | path: |
@ -46,37 +45,30 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }} key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
- name: Lint - name: Lint
run: | run: |
. script/bootstrap . script/bootstrap.sh
yarn lint yarn lint
build-app: build-app:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Build App name: Build App
needs: setup needs: setup
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/setup-node@v3 - uses: actions/setup-node@v4
id: node-setup id: node-setup
with: with:
node-version: ${{ env.NODE_VERSION }} node-version: ${{ env.NODE_VERSION }}
- name: Yarn cache - name: Yarn cache
uses: actions/cache@v3 uses: actions/cache@v4
id: yarn-cache-restore id: yarn-cache-restore
with: with:
path: | path: |
.yarn .yarn
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }} key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
- name: Parcel cache
uses: actions/cache@v3
id: parcel-cache-restore
with:
path: |
.parcel-cache
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}-parcel
- run: | - run: |
. script/bootstrap . script/bootstrap.sh
yarn build yarn build
- name: Build Artifacts - name: Build Artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: build-artifacts name: build-artifacts
path: dist path: dist
@ -86,21 +78,21 @@ jobs:
if: ${{ github.ref != 'refs/heads/main' }} if: ${{ github.ref != 'refs/heads/main' }}
needs: build-app needs: build-app
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/setup-node@v3 - uses: actions/setup-node@v4
id: node-setup id: node-setup
with: with:
node-version: ${{ env.NODE_VERSION }} node-version: ${{ env.NODE_VERSION }}
- name: Yarn cache - name: Yarn cache
uses: actions/cache@v3 uses: actions/cache@v4
id: yarn-cache-restore id: yarn-cache-restore
with: with:
path: | path: |
.yarn .yarn
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }} key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
- run: . script/bootstrap - run: . script/bootstrap.sh
- name: Build Artifacts - name: Build Artifacts
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-artifacts name: build-artifacts
path: dist path: dist
@ -113,7 +105,7 @@ jobs:
yarn netlify deploy --dir=dist --json | jq .deploy_url > output.log yarn netlify deploy --dir=dist --json | jq .deploy_url > output.log
echo "::set-output name=draft-url::$(cat output.log)" echo "::set-output name=draft-url::$(cat output.log)"
- name: Report - name: Report
uses: actions/github-script@v6 uses: actions/github-script@v7
env: env:
DRAFT_URL: ${{ steps.preview-deploy.outputs.draft-url }} DRAFT_URL: ${{ steps.preview-deploy.outputs.draft-url }}
with: with:
@ -131,21 +123,21 @@ jobs:
needs: build-app needs: build-app
if: ${{ github.ref == 'refs/heads/main' }} if: ${{ github.ref == 'refs/heads/main' }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/setup-node@v3 - uses: actions/setup-node@v4
id: node-setup id: node-setup
with: with:
node-version: ${{ env.NODE_VERSION }} node-version: ${{ env.NODE_VERSION }}
- name: Yarn cache - name: Yarn cache
uses: actions/cache@v3 uses: actions/cache@v4
id: yarn-cache-restore id: yarn-cache-restore
with: with:
path: | path: |
.yarn .yarn
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }} key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
- run: . script/bootstrap - run: . script/bootstrap.sh
- name: Build Artifacts - name: Build Artifacts
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-artifacts name: build-artifacts
path: dist path: dist

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
if [[ $CI != 1 ]]; then if [[ -z "${CI+true}" ]]; then
nvm use nvm use
fi fi