Skip to content

format correctly

format correctly #13

name: azure deploy www prod

Check failure on line 1 in .github/workflows/azure-deploy-www.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/azure-deploy-www.yml

Invalid workflow file

(Line: 75, Col: 26): Unrecognized named-value: 'RESOURCE_GROUP'. Located at position 1 within expression: RESOURCE_GROUP, (Line: 76, Col: 29): Unrecognized named-value: 'APP_NAME'. Located at position 1 within expression: APP_NAME, (Line: 77, Col: 36): Unrecognized named-value: 'CONTAINERAPPS_ENV'. Located at position 1 within expression: CONTAINERAPPS_ENV, (Line: 78, Col: 20): Unrecognized named-value: 'ACR_NAME'. Located at position 1 within expression: ACR_NAME, (Line: 79, Col: 26): Unrecognized named-value: 'IMAGE'. Located at position 1 within expression: IMAGE, (Line: 80, Col: 23): Unrecognized named-value: 'PORT'. Located at position 1 within expression: PORT
run-name: Deploy to www to ${{ inputs.environment }} by @${{ github.actor }}
on:
workflow_call:
inputs:
environment:
required: true
type: string
description: 'Deployment environment (production, preview)'
pr_number:
required: false
type: string
description: 'PR number for preview deployments'
update_comment:
required: false
type: boolean
default: false
description: 'Whether to update PR comment with deployment URL'
secrets:
AZURE_CLIENT_ID:
required: true
AZURE_TENANT_ID:
required: true
AZURE_SUBSCRIPTION_ID:
required: true
permissions:
id-token: write # needed for OIDC
contents: read
concurrency:
group: azure-www-prod-deploy
cancel-in-progress: true
env:
RESOURCE_GROUP: ${{ inputs.environment == 'production' && 'rg-designsystemet-prod' || 'rg-designsystemet-test' }}
CONTAINERAPPS_ENV: ${{ inputs.environment == 'production' && 'www-prod-ca' || 'www-test-ca' }}
ACR_NAME: designsystemetacr
APP_NAME: ${{ inputs.environment == 'production' && 'www-prod' || format('www-test-pr-{0}', inputs.pr_number) }}
IMAGE: ${{ inputs.pr_number && format('{0}-{1}', inputs.pr_number, github.sha) || format('{0}-{1}', github.run_id, github.sha) }}
PORT: 8000
jobs:
deploy:
runs-on: ubuntu-latest
environment: azure
outputs:
fqdn: ${{ steps.fqdn.outputs.fqdn }}
steps:
- uses: actions/checkout@v4
- name: az login (oidc)
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: acr login
run: az acr login --name designsystemetacr
- name: build & push (www)
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
with:
context: .
file: ./Dockerfile
target: www
platforms: linux/amd64
push: true
tags: designsystemetacr.azurecr.io/www:latest
- name: deploy
uses: azure/container-apps-deploy-action@29ee19866ec987ededd70b8412d9ee241a9102d1 # v1
with:
resourceGroup: ${{ RESOURCE_GROUP }}
containerAppName: ${{ APP_NAME }}
containerAppEnvironment: ${{ CONTAINERAPPS_ENV }}
acrName: ${{ ACR_NAME }}
imageToDeploy: ${{ IMAGE }}
targetPort: ${{ PORT }}
ingress: external
environmentVariables: |
PORT=${PORT}
HOST=0.0.0.0
ENV=${{ inputs.environment }}
- name: fetch fqdn
id: fqdn
run: |
FQDN=$(az containerapp show -n "${APP_NAME}" -g "${RESOURCE_GROUP}" --query properties.configuration.ingress.fqdn -o tsv)
echo "fqdn=${FQDN}" >> "$GITHUB_OUTPUT"
update-comment:
if: ${{ inputs.update_comment }}
needs: deploy
uses: ./.github/workflows/preview-comment.yml
with:
pr_number: ${{ github.event.number }}
deployment_type: theme
deployment_url: https://${{ needs.deploy.outputs.fqdn }}