Skip to content

Commit

Permalink
test new runner on deploy pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio-cialini committed Nov 19, 2024
1 parent 375b38e commit 23dca3e
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions .github/workflows/deploy_with_github_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,32 @@ permissions:
contents: read

jobs:
create_runner:
name: Create Runner
runs-on: ubuntu-22.04
environment:
name: ${{ inputs.environment }}
outputs:
runner_name: ${{ steps.create_github_runner.outputs.runner_name }}
steps:
- name: Create GitHub Runner
id: create_github_runner
# from https://github.com/pagopa/eng-github-actions-iac-template/tree/main/azure/github-self-hosted-runner-azure-create-action
uses: pagopa/eng-github-actions-iac-template/azure/github-self-hosted-runner-azure-create-action@main
with:
client_id: ${{ secrets.CLIENT_ID }}
tenant_id: ${{ secrets.TENANT_ID }}
subscription_id: ${{ secrets.SUBSCRIPTION_ID }}
container_app_environment_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_NAME }}
resource_group_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_RESOURCE_GROUP_NAME }} # RG of the runner
pat_token: ${{ secrets.BOT_TOKEN_GITHUB }}
self_hosted_runner_image_tag: "latest"
# create_runner:
# name: Create Runner
# runs-on: self-hosted
# environment:
# name: github-${{ inputs.environment }}
# outputs:
# runner_name: ${{ steps.create_github_runner.outputs.runner_name }}
# steps:
# - name: Create GitHub Runner
# id: create_github_runner
# # from https://github.com/pagopa/eng-github-actions-iac-template/tree/main/azure/github-self-hosted-runner-azure-create-action
# uses: pagopa/eng-github-actions-iac-template/azure/github-self-hosted-runner-azure-create-action@main
# with:
# client_id: ${{ secrets.CLIENT_ID }}
# tenant_id: ${{ secrets.TENANT_ID }}
# subscription_id: ${{ secrets.SUBSCRIPTION_ID }}
# container_app_environment_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_NAME }}
# resource_group_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_RESOURCE_GROUP_NAME }} # RG of the runner
# pat_token: ${{ secrets.BOT_TOKEN_GITHUB }}
# self_hosted_runner_image_tag: "latest"

deploy:
needs: [ create_runner ]
# needs: [ create_runner ]
runs-on: [ self-hosted, "${{ needs.create_runner.outputs.runner_name }}" ]
name: Deploy on AKS
environment: ${{ inputs.environment }}
environment: github-${{ inputs.environment }}
steps:
- name: Deploy
uses: pagopa/github-actions-template/aks-deploy@main
Expand All @@ -58,24 +58,24 @@ jobs:
app_name: ${{ env.APP_NAME }}
helm_upgrade_options: "--debug"

cleanup_runner:
name: Cleanup Runner
needs: [ create_runner, deploy ]
if: ${{ success() || failure() }}
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
steps:
- name: Cleanup GitHub Runner
id: cleanup_github_runner
# from https://github.com/pagopa/eng-github-actions-iac-template/tree/main/azure/github-self-hosted-runner-azure-cleanup-action
uses: pagopa/eng-github-actions-iac-template/azure/github-self-hosted-runner-azure-cleanup-action@main
with:
client_id: ${{ secrets.CLIENT_ID }}
tenant_id: ${{ secrets.TENANT_ID }}
subscription_id: ${{ secrets.SUBSCRIPTION_ID }}
resource_group_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_RESOURCE_GROUP_NAME }}
runner_name: ${{ needs.create_runner.outputs.runner_name }}
pat_token: ${{ secrets.BOT_TOKEN_GITHUB }}
# cleanup_runner:
# name: Cleanup Runner
# needs: [ create_runner, deploy ]
# if: ${{ success() || failure() }}
# runs-on: ubuntu-22.04
# environment: ${{ inputs.environment }}
# steps:
# - name: Cleanup GitHub Runner
# id: cleanup_github_runner
# # from https://github.com/pagopa/eng-github-actions-iac-template/tree/main/azure/github-self-hosted-runner-azure-cleanup-action
# uses: pagopa/eng-github-actions-iac-template/azure/github-self-hosted-runner-azure-cleanup-action@main
# with:
# client_id: ${{ secrets.CLIENT_ID }}
# tenant_id: ${{ secrets.TENANT_ID }}
# subscription_id: ${{ secrets.SUBSCRIPTION_ID }}
# resource_group_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_RESOURCE_GROUP_NAME }}
# runner_name: ${{ needs.create_runner.outputs.runner_name }}
# pat_token: ${{ secrets.BOT_TOKEN_GITHUB }}

update_openapi:
needs: [ deploy ]
Expand Down

0 comments on commit 23dca3e

Please sign in to comment.