Skip to content

Commit aa5e89a

Browse files
committed
Build and publish workflow
1 parent 27a9a02 commit aa5e89a

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Workflow for deploying website build
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+
16+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
18+
concurrency:
19+
group: "publish"
20+
cancel-in-progress: false
21+
22+
jobs:
23+
# Build job
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v6
29+
with:
30+
fetch-depth: 1
31+
32+
- name: Cache JS dependencies
33+
uses: actions/cache@v5
34+
with:
35+
path: ~/.npm
36+
key: dependencies-js-npm-${{ hashFiles('portal/package-lock.json') }}
37+
38+
- name: Setup PHP
39+
uses: shivammathur/setup-php@v2
40+
with:
41+
php-version: '8.3'
42+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, relay, ffi
43+
coverage: none
44+
45+
- name: Composer install
46+
uses: "ramsey/composer-install@v2"
47+
48+
- name: JS install
49+
run: |
50+
npm ci
51+
52+
- name: Build static website
53+
run: |
54+
echo "APP_URL=https://contentmd.org" >> .env && \
55+
npm run build -- --base https://contentmd.org
56+
57+
58+
- name: Upload artifact
59+
uses: actions/upload-pages-artifact@v5
60+
with:
61+
path: build_production/
62+
63+
# Deployment job
64+
deploy:
65+
environment:
66+
name: website
67+
url: 'https://contentmd.org'
68+
runs-on: ubuntu-latest
69+
needs: build
70+
steps:
71+
- name: Deploy
72+
id: deployment
73+
# ${{ steps.deployment.outputs.page_url }}
74+
run: |
75+
ls -lah

0 commit comments

Comments
 (0)