Skip to content

Set up GitHub Actions workflow for GitHub Pages deployment - 2 #3

Set up GitHub Actions workflow for GitHub Pages deployment - 2

Set up GitHub Actions workflow for GitHub Pages deployment - 2 #3

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- main # Trigger on push to main branch
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3 # Latest version of checkout action
- name: Configure Git
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4 # Latest version of gh-pages action
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # Provided by GitHub
publish_dir: ./ # The directory to deploy
- name: Force Push to gh-pages
run: |
git push origin gh-pages --force