Skip to content

Commit

Permalink
Update GitHub Pages workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
insulationman committed Mar 7, 2024
1 parent 2a17749 commit 714c3b0
Showing 1 changed file with 27 additions and 37 deletions.
64 changes: 27 additions & 37 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,43 @@
name: Deploy to GitHub Pages

on:
# Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branch’s name
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
branches:
- main

# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 20
- name: npm ci, build
run: |
npm ci
npm run build
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
name: page
path: "dist/"
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}

url: ${{ steps.deploy.outputs.page_url }}
steps:
- uses: actions/download-artifact@master
# Checkout project repository
- name: Checkout
uses: actions/checkout@v3

# Setup Node.js environment
- name: Setup Node.js
uses: actions/setup-node@v3
with:
name: page
path: .
- uses: actions/configure-pages@v1
- uses: actions/upload-pages-artifact@v3
node-version: "18.x"

# Install dependencies
- name: Install dependencies
run: npm install --prefer-offline

# Build Application
- name: Build application
run: npm build

# Deploy to Github Pages
- id: deploy
name: Deploy to Github Pages
uses: fcodelabs/[email protected]
with:
path: .
- id: deployment
uses: actions/deploy-pages@main
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 714c3b0

Please sign in to comment.