-
Notifications
You must be signed in to change notification settings - Fork 27
81 lines (68 loc) · 2.81 KB
/
publish-CFP.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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.0
- 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 }}