Add clean branch deployment workflow #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Workflow for deploying development version to GitHub Pages | |
name: Deploy Development Site | |
on: | |
push: | |
branches: ["gh-pages-test"] # Our development branch | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: write # Changed to write to allow branch creation | |
pages: write | |
id-token: write | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.141.0' | |
extended: true | |
- name: Build | |
run: hugo --minify | |
env: | |
HUGO_ENV: development # Mark as development environment | |
HUGO_BASEURL: https://01builders.github.io/binary.builders/dev/ # Development URL | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |
publish_branch: gh-pages # Deploy to gh-pages branch | |
destination_dir: dev # Put in /dev subdirectory | |
keep_files: true # Don't delete other files (like production) |