Create and register self-hosted runners #102
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: Create and register self-hosted runners | |
on: | |
workflow_dispatch: | |
inputs: | |
useJobs: | |
description: Use Container Apps jobs instead of Container Apps | |
type: boolean | |
default: true | |
required: true | |
permissions: | |
id-token: write | |
contents: read | |
defaults: | |
run: | |
working-directory: infra | |
jobs: | |
provision-runners: | |
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@v3 | |
- name: Azure Login | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ vars.AZURE_CLIENT_ID }} | |
tenant-id: ${{ vars.AZURE_TENANT_ID }} | |
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} | |
- name: Deploy Container App Job | |
uses: azure/arm-deploy@v1 | |
if: inputs.useJobs | |
with: | |
scope: resourcegroup | |
resourceGroupName: ${{ vars.RG_NAME }} | |
template: ./infra/02-job/main.bicep | |
parameters: > | |
project=${{ vars.PROJECT }} | |
acrName=${{ vars.ACR_NAME }} | |
acaEnvName=${{ vars.ACA_ENV_NAME }} | |
imageTag=from-base | |
gitHubAppId=${{ vars.GH_APP_ID }} | |
gitHubAppInstallationId=${{ vars.GH_APP_INSTALLATION_ID }} | |
gitHubAppKeySecretUri=${{ vars.GH_APP_PRIVATE_KEY_SECRET_URI }} | |
gitHubOrganization=${{ github.repository_owner }} | |
deploymentName: deploy-aca-gh-runners-job | |
- name: Deploy Container App | |
uses: azure/arm-deploy@v1 | |
if: ${{ ! inputs.useJobs }} | |
with: | |
scope: resourcegroup | |
resourceGroupName: ${{ vars.RG_NAME }} | |
template: ./infra/02-app/main.bicep | |
parameters: > | |
project=${{ vars.PROJECT }} | |
acrName=${{ vars.ACR_NAME }} | |
acaEnvName=${{ vars.ACA_ENV_NAME }} | |
imageTag=from-base | |
gitHubAppId=${{ vars.GH_APP_ID }} | |
gitHubAppInstallationId=${{ vars.GH_APP_INSTALLATION_ID }} | |
gitHubAppKeySecretUri=${{ vars.GH_APP_PRIVATE_KEY_SECRET_URI }} | |
gitHubOrganization=${{ github.repository_owner }} | |
deploymentName: deploy-aca-gh-runners-app |