Skip to content

adjust paipe

adjust paipe #18

name: Azure Static Web Apps CI/CD
on:
push:
branches:
- xmacna-prod
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- xmacna-prod
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
env:
DIRECTUS_URL: ${{ secrets.DIRECTUS_URL }}
DIRECTUS_SERVER_TOKEN: ${{ secrets.DIRECTUS_SERVER_TOKEN }}
SITE_URL: ${{ secrets.SITE_URL }}
COREPACK_ENABLE_STRICT: '0'
VERBOSE: true
steps:
- uses: actions/checkout@v3
with:
submodules: true
lfs: false
- name: Use pnpm ${{ env.PNPM_VERSION }}
uses: pnpm/action-setup@v3
with:
version: ${{ env.PNPM_VERSION }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install
run: |
# force a development install, to make sure dev dependencies are installed
# they get filtered out by the standalone build for next
NODE_ENV=development pnpm install
env:
VERBOSE: true
- name: Build
run: pnpm run build --preset=azure
env:
VERBOSE: true
- 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_MANGO_TREE_026B9B70F }}
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
skip_app_build: true
skip_api_build: true
app_location: '.output/public'
api_location: '.output/server'
output_location: ''
###### End of Repository/Build Configurations ######
env:
skip_deploy_on_missing_secrets: true
VERBOSE: true
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_MANGO_TREE_026B9B70F }}
action: 'close'