Skip to content

Using Html-Base Plugin #254

Using Html-Base Plugin

Using Html-Base Plugin #254

Workflow file for this run

name: CI/CD
on:
push:
branches:
- main
- '!post/**'
paths-ignore:
- 'docs/**/*'
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main
- '!post/**'
paths-ignore:
- 'docs/**/*.*'
jobs:
build_and_deploy:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy
steps:
- name: Checkout
uses: actions/checkout@v2
with:
lfs: true
submodules: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Generate DotEnv File
uses: iamsauravsharma/create-dotenv@v1.2.1
with:
env-prefix: "DOTENV_"
env:
DOTENV_AI_CONNECTION_STRING: ${{ secrets.AI_CONNECTION_STRING }}
- name: Build
id: build
run: |
npm install
npm run build
- name: Deploy
id: deploy
uses: Azure/static-web-apps-deploy@v1
with:
production_branch: "main"
azure_static_web_apps_api_token: ${{ secrets.SWA_DEPLOY_TOKEN }}
repo_token: ${{ secrets.GH_WORKFLOW_TOKEN }}
action: "upload"
app_location: "dist"
skip_app_build: true
close_pull_request:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close PR
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.SWA_DEPLOY_TOKEN }}
repo_token: ${{ secrets.GH_WORKFLOW_TOKEN }}
action: "close"