Fix commit
Some checks failed
Deploy to GitHub Pages / build (push) Failing after 53s
Deploy to GitHub Pages / deploy (push) Has been skipped

This commit is contained in:
Magnus Smari Smarason
2025-05-17 22:07:28 +00:00
parent e41c77a48b
commit b15288ef42

View File

@ -1,28 +1,55 @@
name: Deploy to GitHub Pages
on:
# Runs on pushes targeting the default branch
push:
branches:
- main # Or your default branch
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
# Build job
build:
runs-on: ubuntu-latest
permissions:
contents: write # Allows gh-pages to push to the gh-pages branch
steps:
- name: Checkout repository
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Or your preferred Node.js version
node-version: "20" # Or your preferred Node.js version
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build # This should output to 'dist' based on your package.json
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload dist folder
path: "./dist"
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
run: npx gh-pages -d dist --repo "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" --user "GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Ensures token is available if gh-pages or git commands need it directly
id: deployment
uses: actions/deploy-pages@v4