Skip to content

Commit

Permalink
Merge branch 'main' into test
Browse files Browse the repository at this point in the history
Thomas Fink authored and Thomas Fink committed Jan 24, 2025
2 parents 2477ee8 + 202e0e4 commit b6eb621
Showing 4 changed files with 36 additions and 28 deletions.
46 changes: 19 additions & 27 deletions .github/workflows/static.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
# Workflow for deploying zmsapi PHP and Node.js static content to Pages
name: Deploy zmsapi static content to Pages
# Workflow for deploying API documentation to Pages
name: Deploy API Documentation to Pages

on:
# Runs on pushes targeting the default branch (main)
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
concurrency:
group: "pages"
cancel-in-progress: false
@@ -28,64 +23,61 @@ jobs:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository
- name: Checkout
uses: actions/checkout@v4

# Step 2: Set up PHP environment
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0' # Specify PHP version as per your requirement
php-version: '8.0'
extensions: mbstring, json
tools: composer

# Step 3: Install PHP dependencies for zmsapi
- name: Install PHP dependencies
run: |
composer install --working-dir=zmsapi
composer install --working-dir=zmscitizenapi
# Step 4: Run PHP post-install scripts for zmsapi
- name: Run PHP post-install scripts
run: |
cd zmsapi && bin/configure && composer run-script post-install-cmd && cd ..
cd zmscitizenapi && bin/configure && composer run-script post-install-cmd && cd ..
# Step 5: Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16' # Specify Node.js version as needed
node-version: '16'

# Step 6: Install Node.js dependencies for zmsapi
- name: Install Node.js dependencies for zmsapi
- name: Install Node.js dependencies
run: |
cd zmsapi
npm install
cd zmsapi && npm install && cd ..
cd zmscitizenapi && npm install && cd ..
# Step 7: Build the project for zmsapi
- name: Build zmsapi
- name: Build projects
run: |
cd zmsapi
npm run build
cd zmsapi && npm run build && cd ..
cd zmscitizenapi && npm run build && cd ..
# Step 8: Generate Swagger documentation for zmsapi
- name: Generate Swagger documentation
run: |
cd zmsapi
npm run doc
npx swagger-cli bundle -o public/doc/swagger.json public/doc/swagger.yaml
cd ..
cd zmscitizenapi
npm run doc
npx swagger-cli bundle -o public/doc/swagger.json public/doc/swagger.yaml
cd ..
# Step 9: Set up GitHub Pages for deployment
- name: Setup Pages
uses: actions/configure-pages@v5

# Step 10: Upload the static content to GitHub Pages
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '.' # Upload the entire repository, including the generated docs
path: '.'

# Step 11: Deploy to GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 3 additions & 1 deletion zmsapi/composer.json
Original file line number Diff line number Diff line change
@@ -47,18 +47,20 @@
"scripts": {
"clean": "rm -f public/doc/assets/*.* && rm -f public/_test/assets/*.*",
"command": "bin/configure",
"prepare-dirs": "mkdir -p public/_test/assets && mkdir -p public/doc/assets",
"wget-files": [
"wget https://eappointment.gitlab.io/zmsapi/doc/swagger.json -O public/doc/swagger.json",
"wget https://eappointment.gitlab.io/zmsapi/doc/assets/redoc.min.js -O public/doc/assets/redoc.min.js",
"wget https://eappointment.gitlab.io/zmsapi/_test/assets/swagger-ui-bundle.js -O public/_test/assets/swagger-ui-bundle.js",
"wget https://eappointment.gitlab.io/zmsapi/_test/assets/swagger-ui.css -O public/_test/assets/swagger-ui.css",
"wget https://eappointment.gitlab.io/zmsapi/_test/assets/swagger-ui-standalone-preset.js -O public/_test/assets/swagger-ui-standalone-preset.js",
"sha256sum --status -c checksums.txt"
],
"post-install-cmd": [
"@prepare-dirs",
"@wget-files"
],
"post-update-cmd": [
"@prepare-dirs",
"@wget-files"
]
},
4 changes: 4 additions & 0 deletions zmscitizenapi/checksums.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
7f700a62cf9c402a09313486b461a06233a4f46ed29d8e38f27f07668fc60591 public/doc/assets/redoc.min.js
73cc9ec630f285bebd75544742055fa89792543ef989e985cbfed217412f6d34 public/_test/assets/swagger-ui-bundle.js
f9e1d39b7fe5b0b472743b42be2b472249feae67c89d63593ce72674c33ca4dd public/_test/assets/swagger-ui.css
68a210d666aa74d72f3001757474a52ba3c5dd03deac11803d2e9ec9c8d6a3c1 public/_test/assets/swagger-ui-standalone-preset.js
10 changes: 10 additions & 0 deletions zmscitizenapi/composer.json
Original file line number Diff line number Diff line change
@@ -38,10 +38,20 @@
"scripts": {
"clean": "rm -f public/doc/assets/*.* && rm -f public/_test/assets/*.*",
"command": "bin/configure",
"prepare-dirs": "mkdir -p public/_test/assets && mkdir -p public/doc/assets",
"wget-files": [
"wget https://eappointment.gitlab.io/zmsapi/doc/assets/redoc.min.js -O public/doc/assets/redoc.min.js",
"wget https://eappointment.gitlab.io/zmsapi/_test/assets/swagger-ui-bundle.js -O public/_test/assets/swagger-ui-bundle.js",
"wget https://eappointment.gitlab.io/zmsapi/_test/assets/swagger-ui.css -O public/_test/assets/swagger-ui.css",
"wget https://eappointment.gitlab.io/zmsapi/_test/assets/swagger-ui-standalone-preset.js -O public/_test/assets/swagger-ui-standalone-preset.js",
"sha256sum --status -c checksums.txt"
],
"post-install-cmd": [
"@prepare-dirs",
"@wget-files"
],
"post-update-cmd": [
"@prepare-dirs",
"@wget-files"
]
},

0 comments on commit b6eb621

Please sign in to comment.