Skip to content

Push to GitHub Pages on push to main #1044

Push to GitHub Pages on push to main

Push to GitHub Pages on push to main #1044

Workflow file for this run

name: Push to GitHub Pages on push to main
on:
schedule:
# every day at midnight: https://crontab.guru/every-midnight
- cron: '0 0 * * *'
# Trigger the workflow on push or pull request for master branch
push:
branches:
- main
pull_request:
branches:
- main
# Manually trigger workflow
workflow_dispatch:
jobs:
build:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v1
- name: Build hugo page
run: |
wget https://github.com/gohugoio/hugo/releases/download/v0.88.1/hugo_extended_0.88.1_Linux-64bit.deb
sudo dpkg -i hugo*.deb
rm -rf public 2> /dev/null
rm *.deb
hugo --debug --path-warnings
touch public/.nojekyll
# Deploy to local repo
- name: Deploy
if: github.ref == 'refs/heads/main'
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: gh-pages
FOLDER: public
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}