Skip to content

Commit b7ae93c

Browse files
authored
Build pages flow (#1)
1 parent b3c2c54 commit b7ae93c

1 file changed

Lines changed: 86 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy static content to Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["main"]
8+
9+
pull_request:
10+
types: [opened, synchronize, reopened]
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23+
concurrency:
24+
group: "pages"
25+
cancel-in-progress: false
26+
27+
jobs:
28+
# Build job
29+
build:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 1
36+
37+
- name: Setup Pages
38+
uses: actions/configure-pages@v5
39+
40+
- name: Cache JS dependencies
41+
uses: actions/cache@v4
42+
with:
43+
path: ~/.npm
44+
key: dependencies-js-npm-${{ hashFiles('portal/package-lock.json') }}
45+
46+
- name: Setup PHP
47+
uses: shivammathur/setup-php@v2
48+
with:
49+
php-version: '8.3'
50+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, relay
51+
coverage: none
52+
53+
- name: Composer install
54+
uses: "ramsey/composer-install@v2"
55+
with:
56+
working-directory: "portal"
57+
58+
- name: JS install
59+
run: |
60+
cd portal
61+
npm ci
62+
npm run build
63+
64+
- name: Build static website
65+
run: |
66+
cd portal
67+
npm run build
68+
vendor/bin/jigsaw build production
69+
70+
71+
- name: Upload artifact
72+
uses: actions/upload-pages-artifact@v3
73+
with:
74+
path: portal/build_production/
75+
76+
# Deployment job
77+
deploy:
78+
environment:
79+
name: github-pages
80+
url: ${{ steps.deployment.outputs.page_url }}
81+
runs-on: ubuntu-latest
82+
needs: build
83+
steps:
84+
- name: Deploy to GitHub Pages
85+
id: deployment
86+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)