Skip to content

Update deploy.yml

Update deploy.yml #15

Workflow file for this run

name: GitHub Pages
on:
push:
branches:
- main
- dev
pull_request:
jobs:
deploy:
runs-on: ubuntu-22.04
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.139.4'
extended: true
- name: Set environment variables
run: |
if [[ ${{ github.ref }} == 'refs/heads/dev' ]]; then
echo "HUGO_BASEURL=https://binary.builders/dev/" >> $GITHUB_ENV
else
echo "HUGO_BASEURL=https://binary.builders/" >> $GITHUB_ENV
fi
- name: Build
run: hugo --minify --baseURL ${{ env.HUGO_BASEURL }}
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
destination_dir: ${{ github.ref == 'refs/heads/dev' && 'dev' || '' }}