Skip to content

Update deploy workflow to set remote URL with GITHUB_TOKEN and pass… #3

Update deploy workflow to set remote URL with GITHUB_TOKEN and pass…

Update deploy workflow to set remote URL with GITHUB_TOKEN and pass… #3

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- master
workflow_dispatch:
permissions:
contents: write
jobs:
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: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build website
run: yarn build
- name: Deploy to GitHub Pages
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
yarn deploy
env:
GIT_USER: git
DEPLOYMENT_BRANCH: gh-pages
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}