Skip to content

Commit

Permalink
Add github action to deploy page
Browse files Browse the repository at this point in the history
  • Loading branch information
lassebje committed Oct 2, 2024
1 parent e348193 commit adcaf7c
Show file tree
Hide file tree
Showing 44 changed files with 42 additions and 4 deletions.
File renamed without changes.
41 changes: 41 additions & 0 deletions .github/workflows/deploy_page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Deploy to GitHub Pages

on:
push:
# branches:
# - main # You can change this to the branch you want

jobs:
build:
runs-on: ubuntu-latest

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

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'

- name: Build project
run: |
npm ci
npm run predeploy
- name: Upload build artifacts
uses: actions/upload-pages-artifact@v3 # This stores the build output
with:
path: build

deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write # Allows deployment to GitHub Pages
id-token: write # Needed for GitHub Pages deployment

steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4 # This deploys the stored artifacts
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion web/package.json → package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"predeploy": "npm run build",
"predeploy": "CI=false && npm run build",
"deploy": "gh-pages -d build"
},
"eslintConfig": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions web/.gitignore

This file was deleted.

0 comments on commit adcaf7c

Please sign in to comment.