Deploy prerequisites #32
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: Deploy prerequisites | |
on: | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
deploy-prerequisites: | |
runs-on: ubuntu-latest | |
env: | |
ARM_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }} | |
ARM_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }} | |
ARM_TENANT_ID: ${{ vars.AZURE_TENANT_ID }} | |
ARM_USE_OIDC: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Azure Login | |
uses: azure/login@v1.6.1 | |
with: | |
client-id: ${{ vars.AZURE_CLIENT_ID }} | |
tenant-id: ${{ vars.AZURE_TENANT_ID }} | |
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} | |
- name: Bicep deploy | |
id: bicep-deploy | |
uses: azure/arm-deploy@v2 | |
with: | |
scope: subscription | |
subscriptionId: ${{ vars.AZURE_SUBSCRIPTION_ID }} | |
template: infra/01-prerequisites/main.bicep | |
region: ${{ vars.AZURE_LOCATION }} | |
parameters: > | |
location=${{ vars.AZURE_LOCATION }} | |
gitHubAppKey="${{ secrets.GH_APP_PRIVATE_KEY }}" | |
deploymentName: deploy-aca-gh-runners-dev-prerequisites | |
- name: Generate access token | |
id: generate-access-token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ vars.GH_APP_ID }} | |
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} | |
- name: Update GitHub variables | |
run: | | |
gh variable set PROJECT --body ${{ steps.bicep-deploy.outputs.project }} | |
gh variable set RG_NAME --body ${{ steps.bicep-deploy.outputs.rgName }} | |
gh variable set ACR_NAME --body ${{ steps.bicep-deploy.outputs.acrName }} | |
gh variable set ACA_ENV_NAME --body ${{ steps.bicep-deploy.outputs.acaEnvName }} | |
env: | |
GITHUB_TOKEN: ${{ steps.generate-access-token.outputs.token }} | |
- run: | | |
az acr build -r ${{ steps.bicep-deploy.outputs.acrName }} -g ${{ steps.bicep-deploy.outputs.rgName }} -f src/Dockerfile.from-base -t runners/github/linux:from-base src | |
name: Build and push runner image to the registry |