Deploy to GitHub Pages #70
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: Deploy to GitHub Pages | |
on: | |
push: | |
branches: [ main ] | |
workflow_call: | |
schedule: | |
- cron: '0 2 * * 4' # Every Thursday at 2:00 AM UTC | |
jobs: | |
test: | |
uses: "OpenTermsArchive/opentermsarchive.org/.github/workflows/test.yml@main" | |
deploy: | |
needs: [ test ] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm ci | |
- name: Set Hugo up | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.127.0' | |
extended: true # Prevent error building site: POSTCSS: failed to transform, see https://gohugo.io/troubleshooting/faq/#i-get-this-feature-is-not-available-in-your-current-hugo-version | |
- name: Build with Hugo | |
env: | |
UPTIMEROBOT_API_KEY: ${{ secrets.UPTIMEROBOT_API_KEY }} | |
run: npm run build | |
- name: Deploy ./public directory to the remote gh-pages branch | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
cname: opentermsarchive.org |