This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
Update build.yml to install Hugo using apt instead of Homebrew #20
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
name: CI | |
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 "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Check out latest commit | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
name: Checkout src repo | |
with: | |
path: src | |
fetch-depth: 0 | |
ref: master | |
submodules: recursive | |
# Build hugo website with klakegg/[email protected] action | |
- name: Build website with hugo | |
working-directory: src | |
run: | | |
yes | apt install hugo | |
hugo | |
# Checkout destination repository | |
- name: Checkout dest repo | |
uses: actions/checkout@v2 | |
with: | |
repository: ${{ secrets.DESTREPO }} | |
path: dest | |
ssh-key: | | |
${{ secrets.SSH_PRIVATE_KEY }} | |
# Commit and push changes | |
- name: Copy website built from src/public | |
working-directory: dest | |
run: | | |
yes | cp -rf ../src/public/* . | |
# Commit and push changes | |
- name: Commit website updates | |
working-directory: dest | |
env: | |
SRCREPO: ${{ secrets.SRCREPO }} | |
run: | | |
git config --global user.name github-actions | |
git config --global user.email [email protected] | |
git add . | |
git diff-index --quiet HEAD || git commit -m "Deploy website updates with GitHub Actions: ${SRCREPO}@${GITHUB_SHA}" | |
git push origin master | |
update-submodule: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Check out latest commit (including submodules) | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
name: Checkout src repo | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
ref: master | |
# Commit and push changes | |
- name: Commit submodule updates | |
run: | | |
git config --global user.name github-actions | |
git config --global user.email [email protected] | |
git submodule update --remote public | |
git add . | |
git diff-index --quiet HEAD || git commit -m "Update 'public' submodule" | |
git push origin master |