Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsFlem authored Oct 21, 2024
1 parent 0c58c1b commit e4b067e
Showing 1 changed file with 33 additions and 19 deletions.
52 changes: 33 additions & 19 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,45 @@
name: Deploy to GitHub Pages
name: Deploy React to GitHub Pages

on:
push:
branches:
- main
- main # Branch to deploy from

jobs:
deploy:
build:
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Install Dependencies
run: npm ci

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # Specify Node.js version 20 explicitly
- name: Build
run: npm run build

- name: Install dependencies
run: npm install
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'build/.'

- name: Build the project
run: npm run build
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: 'https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/'
steps:
- name: Setup Pages
uses: actions/configure-pages@v5

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
- name: Deploy
uses: actions/deploy-pages@v4

0 comments on commit e4b067e

Please sign in to comment.