Skip to content
This repository was archived by the owner on Apr 3, 2023. It is now read-only.

Commit 2b129da

Browse files
committed
Upload static website as GitHub artifact and release assets
1 parent b894264 commit 2b129da

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

.github/workflows/export-static-site.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
push:
55
branches:
66
- main
7+
tags:
8+
- 'v*'
9+
10+
concurrency: export-static-site
711

812
jobs:
913
export-static-site:
@@ -19,7 +23,7 @@ jobs:
1923
with:
2024
submodules: recursive
2125

22-
- name: Run "docker compose up" to export static site for Risk Profiler
26+
- name: Run "docker compose up" to export static site for RiskProfiler
2327
run: |
2428
export DOCKER_WP_UID_GID="$(id -u):$(id -g)"
2529
docker compose up --abort-on-container-exit --exit-code-from wpcli
@@ -30,7 +34,30 @@ jobs:
3034
github_token: ${{ secrets.GITHUB_TOKEN }}
3135
publish_dir: ./html_static/riskprofiler
3236

37+
- uses: actions/upload-artifact@v3
38+
with:
39+
name: riskprofiler-ca-static-site
40+
path: html_static/riskprofiler
41+
3342
- uses: actions/upload-artifact@v3
3443
with:
3544
name: simply-static-debug-log
3645
path: wp-app/site/assets/plugins/simply-static/debug.txt
46+
47+
- if: startsWith(github.ref, 'refs/tags/')
48+
name: Create tarball and ZIP file of static site
49+
run: |
50+
rp_ver="${GITHUB_REF/refs\/tags\//}"
51+
cd html_static
52+
GZIP=-9v tar cvzf riskprofiler.ca-static-site-${rp_ver}.tar.gz riskprofiler
53+
zip -9rv riskprofiler.ca-static-site-${rp_ver}.zip riskprofiler
54+
55+
- if: startsWith(github.ref, 'refs/tags/')
56+
name: Upload tarball and ZIP file as release assets
57+
uses: xresloader/upload-to-github-release@v1
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
with:
61+
file: 'html_static/*.tar.gz;html_static/*.zip'
62+
tags: true
63+
draft: false

0 commit comments

Comments
 (0)