chore(deps): update all #944
Workflow file for this run
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: Azure Static Web Apps CI/CD | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
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 | |
outputs: | |
swa_url: ${{ steps.swa.outputs.static_web_app_url }} | |
steps: | |
- name: ποΈ Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: β³ Install Dependencies | |
run: npm ci | |
- name: π§ͺ Unit Test | |
run: npm run test:unit | |
# - name: π Install Playwright | |
# run: npx playwright install --with-deps | |
# - name: π§βπ€βπ§ Fetching Contributors | |
# run: npm run contributors | |
- name: π Build And Deploy | |
id: swa | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_SALMON_ROCK_0FB035B03 }} | |
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: '/' # App source code path | |
api_location: '' # Api source code path - optional | |
output_location: 'build' # Built app content directory - optional | |
production_branch: 'main' | |
###### End of Repository/Build Configurations ###### | |
env: | |
VITE_PUBLIC_HASH: ${{ github.sha }} | |
VITE_PUBLIC_GA_TRACKING_ID: ${{ secrets.GTAG }} | |
VITE_PUBLIC_BASE_PATH: ${{ vars.PUBLIC_BASE_PATH }} | |
smoke_test_job: | |
name: βοΈ Smoke test | |
needs: build_and_deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: ποΈ Checkout | |
uses: actions/checkout@v3 | |
- name: OIDC Login to Azure Public Cloud | |
uses: azure/login@v2 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
enable-AzPSSession: true | |
- name: π οΈ Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.node-version' | |
- name: π Install dependencies | |
run: npm install | |
# Not needed because of Playwright Service | |
# - name: π Install Playwright | |
# run: npx playwright install --with-deps | |
- name: π§ͺ Run Playwright Tests on ${{ needs.build_and_deploy.outputs.swa_url }} | |
run: npx playwright test --config=playwright.service.config.ts | |
env: | |
PLAYWRIGHT_SERVICE_URL: ${{ secrets.PLAYWRIGHT_SERVICE_URL }} | |
PLAYWRIGHT_SERVICE_RUN_ID: ${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }} | |
PLAYWRIGHT_TEST_BASE_URL: ${{ needs.build_and_deploy.outputs.swa_url }} | |
- name: π¦ Upload Test Results Artifact | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-test-results | |
path: playwright-report | |
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_SALMON_ROCK_0FB035B03 }} | |
action: 'close' |