Skip to content

πŸ”’ Fix GitHub Actions deployment permissions #12

πŸ”’ Fix GitHub Actions deployment permissions

πŸ”’ Fix GitHub Actions deployment permissions #12

Workflow file for this run

name: Build and Deploy to GitHub Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions for the workflow
permissions:
contents: write
pages: write
actions: read
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm i
- name: Build with Vite
run: npm run build
- name: Deploy to GitHub Pages
if: success()
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: dist