You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.0 KiB
69 lines
2.0 KiB
---
|
|
on:
|
|
push:
|
|
branches: master
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: write
|
|
contents: write
|
|
deployments: write
|
|
name: Publish to Cloudflare Pages
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Check for missing base language strings
|
|
run: python3 find_missing_i18n_strings.py
|
|
|
|
- name: Setup Hugo
|
|
uses: peaceiris/actions-hugo@v2
|
|
with:
|
|
hugo-version: '0.141.0'
|
|
# extended: true
|
|
|
|
- name: Generate language files
|
|
run: python3 setup-pages-for-supported-languages.py
|
|
|
|
- name: Create Pull Request for i18n string changes
|
|
uses: peter-evans/create-pull-request@v5
|
|
with:
|
|
add-paths: i18n/en.json
|
|
title: Automagic i18n string updates
|
|
commit-message: Automagic i18n string updates
|
|
branch-suffix: short-commit-hash
|
|
delete-branch: true
|
|
body: |
|
|
Changes generated by find_missing_i18n_strings.py
|
|
|
|
OP#217
|
|
|
|
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
|
|
|
|
- name: Build
|
|
run: hugo --minify
|
|
|
|
# this is needed to trick CF into deploying to production
|
|
# can probably be removed where there is a solution to
|
|
# https://github.com/cloudflare/pages-action/issues/63
|
|
- name: remove git dir
|
|
run: rm -rf .git
|
|
|
|
- name: move redirects file into place
|
|
run: cp _redirects public/
|
|
|
|
- name: move headers file into place
|
|
run: cp _headers public/
|
|
|
|
- name: build search index
|
|
run: npx pagefind --site "public"
|
|
|
|
- name: Publish to Cloudflare Pages
|
|
uses: cloudflare/pages-action@v1
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
|
|
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
|
|
directory: public
|
|
|