Skip to content

Commit ea12e94

Browse files
authored
Merge pull request #85 from omsf/feat/prod-deploy-cf
ci: add support for a full-pages build
2 parents 538db83 + 782f096 commit ea12e94

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

.github/workflows/build-push.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build from push
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
env:
11+
HUGO_VERSION: 0.141.0
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
17+
fetch-depth: 0
18+
- name: Build site
19+
uses: omsf/static-site-tools/build/hugo@main
20+
with:
21+
base-url: ""
22+
23+
- name: Make artifact
24+
shell: bash
25+
run: tar czf site.tar.gz public
26+
27+
- name: Upload build artifact
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: site-build
31+
path: site.tar.gz
32+
if-no-files-found: error
33+
retention-days: 1
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Deploy to production
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Build from push"]
6+
types:
7+
- completed
8+
branches:
9+
- main
10+
11+
jobs:
12+
deploy-to-prod:
13+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
14+
uses: omsf/static-site-tools/.github/workflows/prod-cloudflare.yaml@main
15+
with:
16+
run-id: ${{ github.event.workflow_run.id }}
17+
project-name: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
18+
html-dir: public
19+
secrets:
20+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
21+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

0 commit comments

Comments
 (0)