Skip to content

Commit

Permalink
Add GitHub Pages CD via Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mblomdahl committed Feb 2, 2025
1 parent 84b2f26 commit 3e81d27
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/gh-pages-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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: Remove unwanted script from index.html
run: |
sed -i '/<script src="https:\/\/cdn\.gpteng\.co\/gptengineer\.js" type="module"><\/script>/d' ./index.html
- 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
pages: 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 3e81d27

Please sign in to comment.