build: Setup @relative-ci/agent #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Cache packages when the branch is not update-dependencies or dependabot/* | |
- name: Resolve caching | |
id: cache | |
if: ${{ github.ref_name != 'update-dependencies' && !startsWith(github.ref_name, 'dependabot/') }} | |
run: echo "PACKAGE=npm" >> $GITHUB_OUTPUT | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: ${{ steps.cache.outputs.PACKAGE }} | |
# Install dependencies | |
- run: npm ci | |
# Build and output webpack stats to artifacts/webpack-stats.json | |
- run: npm run build | |
working-directory: app | |
env: | |
RELATIVE_CI_KEY: ${{ secrets.RELATIVE_CI_KEY }} | |
RELATIVE_CI_SLUG: "relative-ci/incorrect-slug" | |
DEBUG: relative-ci:agent | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-artifacts | |
path: | | |
artifacts/webpack-stats.json |