Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
saliceti committed Sep 18, 2023
1 parent 724050f commit 70f8daa
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
push:
branches:
- master
- 651-fix-git-api-build-workflow

jobs:
build:
Expand All @@ -36,9 +37,9 @@ jobs:
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Retrieve Slack Webhook from KV
- name: Fetch secrets from key vault
uses: azure/CLI@v1
id: fetch-slack-webhook
id: fetch-secrets
with:
inlineScript: |
SECRET_VALUE=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.INFRA_KEY_VAULT}}" --query "value" -o tsv)
Expand All @@ -49,7 +50,7 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@master
with:
version: v0.9.1
version: v0.9.1 # More recent buildx versions generate an OCI manifest which is incompatible with Cloud Foundry

- name: Get Short SHA
id: vars
Expand Down Expand Up @@ -89,7 +90,7 @@ jobs:
SLACK_COLOR: ${{env.SLACK_FAILURE}}
SLACK_MESSAGE: 'The pipeline has failed to build the API image'
SLACK_TITLE: 'Failure to Build API '
SLACK_WEBHOOK: "${{ steps.fetch-slack-webhook.outputs.SLACK-WEBHOOK }}"
SLACK_WEBHOOK: "${{ steps.fetch-secrets.outputs.SLACK-WEBHOOK }}"

development:
name: Development Deployment
Expand All @@ -109,9 +110,9 @@ jobs:
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Retrieve Slack Webhook from KV
- name: Fetch secrets from key vault
uses: azure/CLI@v1
id: fetch-slack-webhook
id: fetch-secrets
with:
inlineScript: |
SECRET_VALUE=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.INFRA_KEY_VAULT}}" --query "value" -o tsv)
Expand Down Expand Up @@ -158,9 +159,9 @@ jobs:
uses: rtCamp/action-slack-notify@master
env:
SLACK_COLOR: ${{env.SLACK_FAILURE}}
SLACK_MESSAGE: 'TEST MESSAGE'
SLACK_TITLE: 'TEST SLACK TITLE GIT API'
SLACK_WEBHOOK: '${{ steps.fetch-slack-webhook.outputs.SLACK-WEBHOOK }}'
SLACK_MESSAGE: 'Deployment to the development environment has failed'
SLACK_TITLE: 'Deployment to the development environment has failed'
SLACK_WEBHOOK: '${{ steps.fetch-secrets.outputs.SLACK-WEBHOOK }}'

test:
name: Test Deployment
Expand All @@ -180,9 +181,9 @@ jobs:
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Retrieve Slack Webhook from KV
- name: Fetch secrets from key vault
uses: azure/CLI@v1
id: fetch-slack-webhook
id: fetch-secrets
with:
inlineScript: |
SECRET_VALUE=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.INFRA_KEY_VAULT}}" --query "value" -o tsv)
Expand All @@ -202,9 +203,9 @@ jobs:
uses: rtCamp/action-slack-notify@master
env:
SLACK_COLOR: ${{env.SLACK_FAILURE}}
SLACK_MESSAGE: 'The pipeline has failed to build the API image'
SLACK_TITLE: 'Failure to Build API '
SLACK_WEBHOOK: "${{ steps.fetch-slack-webhook.outputs.SLACK-WEBHOOK }}"
SLACK_MESSAGE: 'Deployment to the test environment has failed'
SLACK_TITLE: 'Deployment to the test environment has failed'
SLACK_WEBHOOK: "${{ steps.fetch-secrets.outputs.SLACK-WEBHOOK }}"

# production:
# name: Production Deployment
Expand All @@ -224,9 +225,9 @@ jobs:
# with:
# creds: ${{ secrets.AZURE_CREDENTIALS }}

# - name: Retrieve Slack Webhook from KV
# - name: Fetch secrets from key vault
# uses: azure/CLI@v1
# id: fetch-slack-webhook
# id: fetch-secrets
# with:
# inlineScript: |
# SECRET_VALUE=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.INFRA_KEY_VAULT}}" --query "value" -o tsv)
Expand All @@ -248,4 +249,4 @@ jobs:
# SLACK_COLOR: ${{env.SLACK_FAILURE}}
# SLACK_MESSAGE: 'The pipeline has failed to build the API image'
# SLACK_TITLE: 'Failure to Build API '
# SLACK_WEBHOOK: "${{ steps.fetch-slack-webhook.outputs.SLACK-WEBHOOK }}"
# SLACK_WEBHOOK: "${{ steps.fetch-secrets.outputs.SLACK-WEBHOOK }}"

0 comments on commit 70f8daa

Please sign in to comment.