Skip to content

Merge pull request #107 from franfreezy/main #69

Merge pull request #107 from franfreezy/main

Merge pull request #107 from franfreezy/main #69

name: Azure Static Web Apps CI/CD
on:
push:
branches:
- main # Trigger on push to main, after merging a PR
pull_request:
types: [opened, synchronize, reopened, closed] # For handling PR updates
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed' && github.event.pull_request.merged == true)
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: |
cd frontend
npm install
- name: Build Application
run: |
cd frontend
npm run build
- name: Build and Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_LIVELY_MUD_042177E03 }}
action: "upload"
app_location: "./frontend"
output_location: 'dist'