Skip to content

Commit

Permalink
Add CD for GitHub Pages 🤖
Browse files Browse the repository at this point in the history
  • Loading branch information
mblomdahl authored Dec 4, 2024
1 parent 8487276 commit 82ceec7
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/gh-pages-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: GitHub Pages Deployment

on:
workflow_dispatch:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "20"

- name: Install dependencies
run: npm install

- name: Build project
run: npm run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
permissions:
id-token: write
contents: read
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 82ceec7

Please sign in to comment.