feat!: Update to Node v22 #90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
branches: | |
- master | |
jobs: | |
lint: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
name: Lint | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [ 20.x, 22.x ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- name: Lint API | |
run: | | |
cd api | |
npm ci | |
npm run lint | |
- name: Lint Client | |
run: | | |
cd client | |
npm ci | |
npm run lint | |
build_and_deploy: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
needs: lint | |
runs-on: ubuntu-latest | |
name: Build and Deploy | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- name: Install API dependencies | |
run: | | |
cd api | |
npm ci | |
- name: Install Client dependencies | |
run: | | |
cd client | |
npm ci | |
- name: Deploy | |
id: builddeploy | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ICY_OCEAN_0DD89FE10 }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) | |
action: "upload" | |
###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### | |
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig | |
app_location: "/client" # App source code path | |
api_location: "/api" # Api source code path - optional | |
output_location: "/dist" # Built app content directory - optional | |
###### End of Repository/Build Configurations ###### | |
close_pr_stage: | |
if: github.event_name == 'pull_request' && github.event.action == 'closed' | |
runs-on: ubuntu-latest | |
name: Shutdown PR Stage | |
steps: | |
- name: Shutdown PR Stage | |
id: closepullrequest | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ICY_OCEAN_0DD89FE10 }} | |
action: "close" |