blob: aaad7cf37b40de66ffe5c3c7644e87009dc1b99f [file] [log] [blame]
name: build
on:
push:
branches:
- main-staging
- main
env:
PUBLISH_DIRECTORY: public
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Checkout Staging
if: github.ref_name == 'main-staging'
uses: actions/checkout@v3
with:
ref: asf-staging
path: ${{ env.PUBLISH_DIRECTORY }}
- name: Checkout Production
if: github.ref_name == 'main'
uses: actions/checkout@v3
with:
ref: asf-site
path: ${{ env.PUBLISH_DIRECTORY }}
- name: Install Hugo
run: |
sudo apt-get update
sudo apt-get install hugo
- name: Prepare
working-directory: ${{ env.PUBLISH_DIRECTORY }}
run: |
rm -rf stylesheets
- name: Build
run: |
hugo
- name: Publish
working-directory: ${{ env.PUBLISH_DIRECTORY }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Published changes from $GITHUB_SHA"
git push