Skip to content

Commit

Permalink
TEMP
Browse files Browse the repository at this point in the history
  • Loading branch information
saliceti committed Jan 16, 2025
1 parent 78086d3 commit d1c8e54
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,48 +142,48 @@ jobs:
# SLACK_MESSAGE: Failure deploying release to ${{ matrix.environment }} - Docker tag ${{ needs.docker.outputs.docker_image }}
# SLACK_WEBHOOK: ${{ steps.keyvault-yaml-secret.outputs.SLACK_WEBHOOK }}

deploy_production:
name: Deploy to production environment
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
environment:
name: production
url: ${{ steps.deploy.outputs.environment_url }}
concurrency: deploy_production
needs: [docker, deploy_nonprod]
# deploy_production:
# name: Deploy to production environment
# runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/main' && github.event_name == 'push'
# environment:
# name: production
# url: ${{ steps.deploy.outputs.environment_url }}
# concurrency: deploy_production
# needs: [docker, deploy_nonprod]

outputs:
environment_url: ${{ steps.deploy.outputs.environment_url }}
# outputs:
# environment_url: ${{ steps.deploy.outputs.environment_url }}

steps:
- uses: actions/checkout@v4
# steps:
# - uses: actions/checkout@v4

- uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
# - uses: azure/login@v2
# with:
# creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Fetch secrets from key vault
uses: azure/CLI@v2
id: keyvault-yaml-secret
with:
inlineScript: |
SLACK_WEBHOOK=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.INF_KEY_VAULT }}" --query "value" -o tsv)
echo "::add-mask::$SLACK_WEBHOOK"
echo "SLACK_WEBHOOK=$SLACK_WEBHOOK" >> $GITHUB_OUTPUT
# - name: Fetch secrets from key vault
# uses: azure/CLI@v2
# id: keyvault-yaml-secret
# with:
# inlineScript: |
# SLACK_WEBHOOK=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.INF_KEY_VAULT }}" --query "value" -o tsv)
# echo "::add-mask::$SLACK_WEBHOOK"
# echo "SLACK_WEBHOOK=$SLACK_WEBHOOK" >> $GITHUB_OUTPUT

- uses: ./.github/workflows/actions/deploy
id: deploy
with:
environment: production
docker_image: ${{ needs.docker.outputs.docker_image }}
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
arm-access-key: ${{ secrets.ARM_ACCESS_KEY }}

- name: Slack Notification
if: failure()
uses: rtCamp/action-slack-notify@master
env:
SLACK_COLOR: failure
SLACK_TITLE: Failure deploying release to production
SLACK_MESSAGE: Failure deploying release to production - Docker tag ${{ needs.docker.outputs.docker_image }}
SLACK_WEBHOOK: ${{ steps.keyvault-yaml-secret.outputs.SLACK_WEBHOOK }}
# - uses: ./.github/workflows/actions/deploy
# id: deploy
# with:
# environment: production
# docker_image: ${{ needs.docker.outputs.docker_image }}
# azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
# arm-access-key: ${{ secrets.ARM_ACCESS_KEY }}

# - name: Slack Notification
# if: failure()
# uses: rtCamp/action-slack-notify@master
# env:
# SLACK_COLOR: failure
# SLACK_TITLE: Failure deploying release to production
# SLACK_MESSAGE: Failure deploying release to production - Docker tag ${{ needs.docker.outputs.docker_image }}
# SLACK_WEBHOOK: ${{ steps.keyvault-yaml-secret.outputs.SLACK_WEBHOOK }}

0 comments on commit d1c8e54

Please sign in to comment.