Skip to content

Commit

Permalink
add prd workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nosvalds committed Jul 27, 2021
1 parent b8d4ee0 commit 6198449
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/apim-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy_To_PROD_APIM_On_Push

on:
push:
branches:
- main
paths:
- "service/**"
- ".github/workflows/apim-prod.yml"

jobs:
validate-deploy-apim:
runs-on: ubuntu-latest

env:
Environment: prod
UrlEnvPrefix: prod-
SubscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resourceGroup: rg-apim-PROD
AZURE_CREDENTIALS: ${{ secrets.PROD_AZURE_CREDENTIALS }}
ApimServiceName: apim-iati-PROD
ApimGatewayHostname: api.iatistandard.org
ApimDevPortalHostname: developer.iatistandard.org
ApimSKU: Standard
ApimCapacity: 2
repoUrl: https://raw.githubusercontent.com/iati/apim-iati-gateway
repoBranch: ${GITHUB_REF##*/}
repoApimPath: service

steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@v2

- name: "Login to Azure"
uses: azure/[email protected]
with:
creds: ${{ env.AZURE_CREDENTIALS }}

# ARM deployment tasks
- name: Deploy APIM Service and APIs
working-directory: ./service
env:
LinkedTemplatesBaseUrl: ${{ env.repoUrl }}/${{ env.repoBranch }}/${{ env.repoApimPath }}
PolicyXMLBaseUrl: ${{ env.repoUrl }}/${{ env.repoBranch }}/${{ env.repoApimPath }}/policies
deploymentName: --name GH_dev_deployment_apim
rg: --resource-group ${{ env.resourceGroup }}
apiNamePrefix: apim-iati-dev
run: |
az deployment group create ${{env.deploymentName}} \
${{env.rg}} \
--template-file ./${{env.apiNamePrefix}}-master.template.json \
--parameters ./${{env.apiNamePrefix}}-parameters.json \
--parameters ApimServiceName=${{ env.ApimServiceName }} \
--parameters LinkedTemplatesBaseUrl=${{ env.LinkedTemplatesBaseUrl }} \
--parameters PolicyXMLBaseUrl=${{ env.PolicyXMLBaseUrl }} \
--parameters Environment=${{ env.Environment }} \
--parameters UrlEnvPrefix=${{ env.UrlEnvPrefix }} \
--parameters SubscriptionId=${{ env.SubscriptionId }} \
--parameters ApimSKU=${{ env.ApimSKU }} \
--parameters ApimCapacity=${{ env.ApimCapacity }} \
--parameters ApimGatewayHostname=${{ env.ApimGatewayHostname }} \
--parameters ApimDevPortalHostname=${{ env.ApimDevPortalHostname }}

0 comments on commit 6198449

Please sign in to comment.