ci(deps): update actions to latest versions
fix: ensure bootstrap script catches CI env
This commit is contained in:
parent
3479a85fa0
commit
27443a1174
2 changed files with 25 additions and 33 deletions
56
.github/workflows/main.yml
vendored
56
.github/workflows/main.yml
vendored
|
@ -6,19 +6,18 @@ on:
|
|||
|
||||
env:
|
||||
NODE_VERSION: 20
|
||||
CI: 1
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
runs-on: ubuntu-latest
|
||||
name: Setup
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
id: node-setup
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@v4
|
||||
id: cache-restore
|
||||
with:
|
||||
path: |
|
||||
|
@ -26,19 +25,19 @@ jobs:
|
|||
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
|
||||
- name: Install dependencies
|
||||
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||
run: . script/bootstrap
|
||||
run: . script/bootstrap.sh
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
name: Lint
|
||||
needs: setup
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
id: node-setup
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: Yarn cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
id: yarn-cache-restore
|
||||
with:
|
||||
path: |
|
||||
|
@ -46,37 +45,30 @@ jobs:
|
|||
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
|
||||
- name: Lint
|
||||
run: |
|
||||
. script/bootstrap
|
||||
. script/bootstrap.sh
|
||||
yarn lint
|
||||
build-app:
|
||||
runs-on: ubuntu-latest
|
||||
name: Build App
|
||||
needs: setup
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
id: node-setup
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: Yarn cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
id: yarn-cache-restore
|
||||
with:
|
||||
path: |
|
||||
.yarn
|
||||
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: |
|
||||
. script/bootstrap
|
||||
. script/bootstrap.sh
|
||||
yarn build
|
||||
- name: Build Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-artifacts
|
||||
path: dist
|
||||
|
@ -86,21 +78,21 @@ jobs:
|
|||
if: ${{ github.ref != 'refs/heads/main' }}
|
||||
needs: build-app
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
id: node-setup
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: Yarn cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
id: yarn-cache-restore
|
||||
with:
|
||||
path: |
|
||||
.yarn
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
|
||||
- run: . script/bootstrap
|
||||
- run: . script/bootstrap.sh
|
||||
- name: Build Artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: build-artifacts
|
||||
path: dist
|
||||
|
@ -113,7 +105,7 @@ jobs:
|
|||
yarn netlify deploy --dir=dist --json | jq .deploy_url > output.log
|
||||
echo "::set-output name=draft-url::$(cat output.log)"
|
||||
- name: Report
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@v7
|
||||
env:
|
||||
DRAFT_URL: ${{ steps.preview-deploy.outputs.draft-url }}
|
||||
with:
|
||||
|
@ -131,21 +123,21 @@ jobs:
|
|||
needs: build-app
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
id: node-setup
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: Yarn cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
id: yarn-cache-restore
|
||||
with:
|
||||
path: |
|
||||
.yarn
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
|
||||
- run: . script/bootstrap
|
||||
- run: . script/bootstrap.sh
|
||||
- name: Build Artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: build-artifacts
|
||||
path: dist
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ $CI != 1 ]]; then
|
||||
if [[ -z "${CI+true}" ]]; then
|
||||
nvm use
|
||||
fi
|
||||
|
Loading…
Reference in a new issue