Skip to content

Add build and deployment actions #1

Add build and deployment actions

Add build and deployment actions #1

Workflow file for this run

name: GitHub Pages Deploy
on:
push:
branches:
- main
workflow_dispatch:
concurrency: production
jobs:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: deploy
run:
name: deploy
on:

Check failure on line 22 in .github/workflows/deploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy.yml

Invalid workflow file

You have an error in your yaml syntax on line 22
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20']
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-tags: true
- name: Set up Node ${{ matrix.node-version }}.x
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Check if package-lock.json is up to date
run: |
npx --yes package-lock-utd@1.1.0
- name: Build
run: |
npm run build
- name: Upload artifact
id: upload-artifact
uses: actions/upload-artifact@v4
with:
path: dist/
if-no-files-found: error
# Deploy job
deploy:
# Add a dependency to the build job
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action