Skip to content

Rebuilding the site on Wed Apr 3 13:39:11 UTC 2024 #65

Rebuilding the site on Wed Apr 3 13:39:11 UTC 2024

Rebuilding the site on Wed Apr 3 13:39:11 UTC 2024 #65

Workflow file for this run

# Workflow to build and deploy site to Github Pages using Hugo
# Name of Workflow
name: Deploy musale.dev
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "deploy"
deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Step 1 - Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: true # Fetch Hugo themes
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
# Step 2 - Sets up the latest version of Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
# Step 3 - Clean and don't fail
# - name: Clean public directory
# run: rm -rf public
# Step 4 - Builds the site using the latest version of Hugo
# Also specifies the theme we want to use
- name: Build
run: hugo --theme=terminal
# Step 5 - Create name file
- name: Check out the public submodule folder and commit files
run: |
cd public
git config --local user.email "[email protected]"
git config --local user.name "Musale Martin"
msg="Rebuilding the site on `date`"
if [ $# -eq 1 ]
then msg="$1"
fi
git add .
git commit -m "$msg"
- name: Push changes to musale.github.io
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_TOKEN_MGI }}
branch: master
repository: musale/musale.github.io
directory: ./public
- name: Update this repo's submodules
run: |
git config --local user.email "[email protected]"
git config --local user.name "Musale Martin"
msg="Rebuilding the site on `date`"
if [ $# -eq 1 ]
then msg="$1"
fi
git add .
git commit -m "$msg"
- name: Push changes to musale-dev
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_TOKEN_MGI }}
branch: master