Skip to content

Commit

Permalink
revert(workflow): to last known good
Browse files Browse the repository at this point in the history
  • Loading branch information
autocloudarc committed Feb 29, 2024
1 parent 92771b0 commit 7c39864
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 66 deletions.
47 changes: 18 additions & 29 deletions .github/workflows/deploy-az-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,26 @@ env:
operation: deploy # allowed values:[ deploy | rollback ]

jobs:
prep:
uses: ./.github/workflows/prepare-for-deploy.yml
with:
operation: deploy
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
test:
needs: prep
stage:
runs-on: ubuntu-latest
environment: dev
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3
if: ${{ env.operation == 'deploy' }}

steps:

# Authenticate to Azure tenant using the Azure login action (OIDC)
- name: Authenticate to Azure with OIDC
uses: Azure/login@v1.6.1
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
enable-AzPSSession: false
if: ${{ env.operation == 'deploy' }}

- name: test-deployment
- name: 'Test Deployment'
uses: azure/CLI@v1
with:
azcliversion: latest
Expand All @@ -72,31 +67,25 @@ jobs:
if: ${{ env.operation == 'deploy' }}
# https://docs.microsoft.com/en-us/cli/azure/deployment/sub?view=azure-cli-latest#az_deployment_sub_what_if
# az deployment sub what-if --location WestUS --template-file ./exercises-dev/main-exercises-dev.bicep --parameters ./exercises-dev/main-exercises-dev.parameters.json
pre-deploy-prep:
needs: test
uses: ./.github/workflows/prepare-for-deploy.yml
with:
operation: deploy
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}

deploy-to-prod:
deliver:
needs: stage
runs-on: ubuntu-latest
environment: prd
needs: pre-deploy-prep
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3

# Authenticate to Azure tenant using the Azure login action (OIDC)
- name: Authenticate to Azure with OIDC
uses: Azure/login@v1.6.1
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
enable-AzPSSession: false
if: ${{ env.operation == 'deploy' }}

# https://github.com/Azure/login
- name: deploy
uses: azure/CLI@v1
with:
Expand All @@ -117,4 +106,4 @@ jobs:
az account show
az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}
az stack sub delete --name ${{ env.stackName }} --delete-all --yes --verbose
if: ${{ env.operation == 'rollback' }}
if: ${{ env.operation == 'rollback' }}
37 changes: 0 additions & 37 deletions .github/workflows/prepare-for-deploy.yml

This file was deleted.

0 comments on commit 7c39864

Please sign in to comment.