Skip to content

Politick 2023 Static Site CI/CD #67

Politick 2023 Static Site CI/CD

Politick 2023 Static Site CI/CD #67

name: Politick 2023 Static Site CI/CD
on:
workflow_dispatch:
push:
paths:
- Politick/**
pull_request:
types: [opened, synchronize, reopened]
jobs:
build_and_deploy_job:
runs-on: ubuntu-latest
name: Build and Deploy Job
if: ((github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch' )
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Packages
run: npm ci
working-directory: ./Politick
- name: Lint Code
working-directory: ./Politick
run: npm run lint
- name: Prettier Check
working-directory: ./Politick
run: npm run format:check
- name: Build Vue App
working-directory: ./Politick
run: npm run build
env:
VUE_APP_PAYPAL_CLIENT_ID: ${{ secrets.PAYPAL_CLIENT_ID }}
- name: Run Vitest Unit Tests
run: npm run test:unit
working-directory: ./Politick
- name: Deploy
if: ((github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch' )
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.DEPLOY_TOKEN }}
#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: "/Politick/dist" # App source code path
skip_app_build: true
output_location: "" # Built app content directory - optional
api_location: "" # Api source code path - optional
###### End of Repository/Build Configurations ######