Skip to content

Commit

Permalink
Add build and deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
ajuvonen committed Dec 27, 2023
1 parent 3fb664c commit f4dc80f
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish to pages

on:
push:
branches: ['main']
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: 'read'
id-token: 'write'
pages: 'write'
actions: 'write'
checks: 'write'
deployments: 'write'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20.10
- name: Install dependencies
run: npm ci
- run: npm run build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: './dist'
deploy:
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

0 comments on commit f4dc80f

Please sign in to comment.