Skip to content

[NOD-473] fix: changed repository for staging slot's action #2

[NOD-473] fix: changed repository for staging slot's action

[NOD-473] fix: changed repository for staging slot's action #2

Workflow file for this run

name: Deploy Azure function
on:
workflow_call:
inputs:
environment:
required: true
description: The name of the environment where to deploy
type: string
target:
required: true
description: The environment target of the job
type: string
resource_group:
required: true
description: The resource group of the function to deploy
type: string
app_name:
required: true
description: The name of the function to deploy
type: string
registry_image:
required: true
description: The name of the image from container registry to be used
type: string
permissions:
id-token: write
contents: read
jobs:
# Starting the Azure Function's staging slot, if deploying in PROD
start_staging_slot:
name: Create staging slots
runs-on: ubuntu-22.04
if: ${{ inputs.target == inputs.environment && inputs.target == 'prod' }}
environment:
name: ${{ inputs.environment }}
uses: pagopa/github-actions-template/azure-function-start-staging-slot@sha # TODO CHANGE HERE

Check failure on line 39 in .github/workflows/04_self_hosted.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/04_self_hosted.yml

Invalid workflow file

invalid value workflow reference: references to workflows must be rooted in '.github/workflows'
with:
branch: ${{ github.ref_name }}
client_id: ${{ secrets.CLIENT_ID }}
tenant_id: ${{ secrets.TENANT_ID }}
subscription_id: ${{ secrets.SUBSCRIPTION_ID }}
resource_group: ${{ inputs.resource_group }}
app_name: ${{ inputs.app_name }}
registry_image: ${{ inputs.registry_image }}
# Executing the deploy of the Azure function with the new image
deploy:
name: Deploy Azure Function
runs-on: ubuntu-22.04
needs: [ create_staging_slot ]
environment:
name: ${{ inputs.environment }}
uses: pagopa/github-actions-template/azure-function-deploy@sha # TODO CHANGE HERE
with:
branch: ${{ github.ref_name }}
client_id: ${{ secrets.CLIENT_ID }}
tenant_id: ${{ secrets.TENANT_ID }}
subscription_id: ${{ secrets.SUBSCRIPTION_ID }}
app_name: ${{ inputs.app_name }}
registry_image: ${{ inputs.registry_image }}
# Stopping the Azure Function's staging slot, if deploying in PROD
stop_staging_slot:
name: Clean staging slots
needs: [ create_staging_slot, deploy ]
if: ${{ success() || failure() && (inputs.target == inputs.environment && inputs.target == 'prod') }}
runs-on: ubuntu-22.04
environment:
name: ${{ inputs.environment }}
uses: pagopa/github-actions-template/azure-function-stop-staging-slot@sha # TODO CHANGE HERE
with:
branch: ${{ github.ref_name }}
client_id: ${{ secrets.CLIENT_ID }}
tenant_id: ${{ secrets.TENANT_ID }}
subscription_id: ${{ secrets.SUBSCRIPTION_ID }}
resource_group: ${{ inputs.resource_group }}
app_name: ${{ inputs.app_name }}
registry_image: ${{ inputs.registry_image }}