Skip to content

Commit

Permalink
fix(ZMS): Update static.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasAFink authored Jan 24, 2025
1 parent 0fe45d6 commit 11bf934
Showing 1 changed file with 19 additions and 27 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
Expand All @@ -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

0 comments on commit 11bf934

Please sign in to comment.