Skip to content

πŸ› Bug - Refactored Erraneous Regex Validation (#1891) #1106

πŸ› Bug - Refactored Erraneous Regex Validation (#1891)

πŸ› Bug - Refactored Erraneous Regex Validation (#1891) #1106

name: Main - build and deploy
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: main
permissions:
id-token: write
contents: read
jobs:
build:
name: Build and upload artifacts
uses: ./.github/workflows/template-build.yml
with:
tag: staging
secrets: inherit
deploy-staging:
name: Deploy to staging slot
needs: build
runs-on: ubuntu-latest
environment:
name: production
url: ${{ steps.deploy.outputs.url }}
permissions:
id-token: write
contents: read
outputs:
url: ${{ steps.deploy.outputs.url }}
steps:
- uses: actions/checkout@v4
- name: Load .env file
uses: xom9ikk/dotenv@v2
with:
path: ./.github
load-mode: strict
- name: Deploy to staging
id: deploy
uses: ./.github/actions/deploy
with:
slot_name: staging
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_RESOURCE_GROUP: ${{ env.AZURE_RESOURCE_GROUP }}
APP_SERVICE_NAME: ${{ env.APP_SERVICE_NAME }}
ACR_LOGIN_SERVER: ${{ env.ACR_LOGIN_SERVER }}
IMAGE_NAME: ${{ env.IMAGE_NAME }}
AZURE_SERVICE_PRINCIPAL_OBJECT_ID: ${{ secrets.AZURE_SERVICE_PRINCIPAL_OBJECT_ID }}
test:
name: Run Playwright Tests
needs: deploy-staging
uses: ./.github/workflows/template-ui-tests.yml
with:
deploy_url: ${{ needs.deploy-staging.outputs.url }}
tests_to_run: "images seo-main"
swap-staging:
name: Swap staging with production
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Load .env file
uses: xom9ikk/dotenv@v2
with:
path: ./.github
load-mode: strict
- name: Azure CLI - Login
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- run: |
az webapp deployment slot swap \
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
--name ${{ env.APP_SERVICE_NAME }} \
--slot staging \
--target-slot production
name: ♻️ Swap slots