Skip to content

Bump google-github-actions/auth from 1 to 2 #447

Bump google-github-actions/auth from 1 to 2

Bump google-github-actions/auth from 1 to 2 #447

Workflow file for this run

name: Deploy Prod to gh pages
on:
push:
branches:
- main
workflow_dispatch: {}
jobs:
deploy-prod:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Checkout build environment
uses: actions/checkout@v4
with:
ref: main
path: build-environment
- uses: actions/[email protected]
with:
node-version: 16
check-latest: true
- name: Get Hugo Version
id: hugo-version
run: |
version=$(jq -r .hugo "build-environment/scripts/.util/tools.json")
echo "version=${version#v}" >> "$GITHUB_OUTPUT"
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ steps.hugo-version.outputs.version }}
extended: true
- name: Build
run: cd build-environment && npm install && hugo
- name: Update
run: |
git rm -r --ignore-unmatch .
cp -a build-environment/public/* .
rm -rf build-environment
- name: Commit
id: commit
run: |
git config --global user.email "[email protected]"
git config --global user.name "paketo-bot"
if [[ -n "$(git status --short)" ]]; then
git add --all .
git commit --message "Deploying"
echo "commit_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
fi
- name: Push
if: ${{ steps.commit.outputs.commit_sha != '' }}
run: git push origin gh-pages