Skip to content

Restructure repo (#15) #88

Restructure repo (#15)

Restructure repo (#15) #88

Workflow file for this run

name: Deploy Actions Runner
on:
push:
branches:
- main
paths:
- infrastructure/aci/**
workflow_dispatch:
inputs:
deployLinuxRunner:
description: 'Deploy Linux Runner'
type: boolean
required: true
default: true
deployWindowsRunner:
description: 'Deploy Windows Runner'
type: boolean
required: true
default: true
env:
ACI_ROOT: ${{ github.workspace }}/src/infrastructure/aci
AZURE_LOCATION: australiaeast
AZURE_RG: ${{ vars.ENV_AZURE_RG }}
ACR_NAME: ${{ vars.ENV_ACR_NAME }}
ACR_SERVER: ${{ vars.ENV_ACR_NAME }}.azurecr.io
SUBNET_ID: ${{ vars.ENV_SUBNET_ID }}
DNS_SERVERS: ${{ vars.ENV_DNS_SERVERS }}
LNX_ACI_NAME: ${{ vars.ENV_LNX_ACI_NAME }}
WIN_ACI_NAME: ${{ vars.ENV_WIN_ACI_NAME }}
LNX_IMAGE_NAME: github-runners/github-runner-linux-amd64:latest
WIN_IMAGE_NAME: github-runners/github-runner-win-amd64:latest
jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.ENV_AZURE_CREDENTIALS }}
- name: Run PSRule
uses: ./.github/actions/ps-rule
with:
TEMPLATE_NAME: ACI
INPUT_PATH: ${{ env.ACI_ROOT }}/.test
deployLinux:
name: Deploy Linux Runner
runs-on: ubuntu-latest
needs: validate
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' || inputs.deployLinuxRunner }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Deploy ACI
uses: ./.github/actions/github-runner-deploy
with:
AZURE_CREDENTIALS: ${{ secrets.ENV_AZURE_CREDENTIALS }}
ROOT: ${{ env.ACI_ROOT }}
AZURE_RG: ${{ env.AZURE_RG }}
ACR_NAME: ${{ env.ACR_NAME }}
ACI_NAME: ${{ env.LNX_ACI_NAME }}
IMAGE_NAME: ${{ env.LNX_IMAGE_NAME }}
GITHUB_TOKEN: ${{ secrets.ENV_GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
ACR_SERVER: ${{ env.ACR_SERVER }}
SUBNET_ID: ${{ env.SUBNET_ID }}
DNS_SERVERS: ${{ env.DNS_SERVERS }}
OS: Linux
deployWindows:
name: Deploy Windows Runner
runs-on: ubuntu-latest
needs: validate
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' || inputs.deployWindowsRunner }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Deploy ACI
uses: ./.github/actions/github-runner-deploy
with:
AZURE_CREDENTIALS: ${{ secrets.ENV_AZURE_CREDENTIALS }}
ROOT: ${{ env.ACI_ROOT }}
AZURE_RG: ${{ env.AZURE_RG }}
ACR_NAME: ${{ env.ACR_NAME }}
ACI_NAME: ${{ env.WIN_ACI_NAME }}
IMAGE_NAME: ${{ env.WIN_IMAGE_NAME }}
GITHUB_TOKEN: ${{ secrets.ENV_GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
ACR_SERVER: ${{ env.ACR_SERVER }}
SUBNET_ID: ${{ env.SUBNET_ID }}
DNS_SERVERS: ${{ env.DNS_SERVERS }}
OS: Windows
INSTANCES_COUNT: 1