Minor corrections #109
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: Publish to Cloudflare Pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
# Exclude pull requests from all repositories except yours | |
# See https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context | |
# See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request | |
if: ${{ github.repository == 'rodrigoalcarazdelaosa/fisiquimicamente' }} | |
permissions: | |
contents: read | |
deployments: write | |
strategy: | |
matrix: | |
include: | |
- projectName: 'fisiquimicamente' | |
directory: 'public/es' | |
GoogleVerificationCode: GOOGLE_VERIFICATION_CODE_ES | |
PDFEmbedKey: PDF_EMBED_API_KEY_ES | |
- projectName: 'physichemically' | |
directory: 'public/en' | |
GoogleVerificationCode: GOOGLE_VERIFICATION_CODE_EN | |
PDFEmbedKey: PDF_EMBED_API_KEY_EN | |
- projectName: 'fisiquimicament' | |
directory: 'public/ca' | |
GoogleVerificationCode: GOOGLE_VERIFICATION_CODE_CA | |
PDFEmbedKey: PDF_EMBED_API_KEY_CA | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# Fetch **all** history (not just deploy commit) for Hugo's .GitInfo and .Lastmod | |
# See https://discourse.gohugo.io/t/problems-with-gitinfo-in-ci/22480 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.20.6 | |
- name: Download Hugo | |
run: wget https://github.com/gohugoio/hugo/releases/download/v${{ env.HUGO_VERSION }}/hugo_extended_${{ env.HUGO_VERSION }}_linux-amd64.deb -O hugo_extended_${{ env.HUGO_VERSION }}_linux-amd64.deb | |
# 0.103.0 began new naming convention | |
env: | |
HUGO_VERSION: 0.116 | |
- name: Install Hugo | |
run: sudo dpkg -i hugo*.deb | |
- name: Cache Hugo resources | |
id: cache-hugo-resources | |
uses: actions/cache@v3 | |
with: | |
path: resources | |
key: ${{ runner.os }}-hugo-resources | |
- name: Build site with Hugo | |
run: source get_last_commit_hash.sh && hugo --buildFuture --gc --minify | |
env: | |
HUGOxPARAMSxMARKETINGxVERIFICATIONxGOOGLE: ${{ secrets[matrix.GoogleVerificationCode] }} | |
HUGOxPARAMSxPDF_EMBED_API_KEY: ${{ secrets[matrix.PDFEmbedKey] }} | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: ${{ matrix.projectName }} | |
directory: ${{ matrix.directory }} | |
# Optional: Enable this if you want to have GitHub Deployments triggered | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} |