Skip to content

Commit

Permalink
Merge pull request #3651 from DFE-Digital/747-migrate-development-env…
Browse files Browse the repository at this point in the history
…-to-aks

Migrate dev env to aks
  • Loading branch information
RMcVelia authored Oct 26, 2023
2 parents f109b87 + 2037ec3 commit 575f85a
Showing 1 changed file with 19 additions and 104 deletions.
123 changes: 19 additions & 104 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,14 @@ jobs:
with:
labels: Review_v2

development:
name: Development Deployment
development_aks:
name: Development AKS Deployment
needs: [ feature_tests, javascript_tests, build_release ]
if: github.ref == 'refs/heads/master'
concurrency: Development
concurrency: Development_aks
runs-on: ubuntu-latest
environment:
name: development_aks
outputs:
release_tag: ${{steps.tag_version.outputs.pr_number}}
release_sha: ${{github.sha }}
Expand All @@ -525,23 +527,27 @@ jobs:

- name: set-up-environment
uses: DFE-Digital/github-actions/set-up-environment@master
with:
var_file: .github/common_environment_aks.yml

- uses: Azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- uses: DfE-Digital/keyvault-yaml-secret@v1
id: keyvault-yaml-secret
- name: Fetch secrets from key vault
uses: azure/CLI@v1
id: keyvault-yaml-secret
with:
keyvault: ${{ secrets.KEY_VAULT}}
secret: INFRA-KEYS
key: SLACK-WEBHOOK
inlineScript: |
SLACK_WEBHOOK=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.KEY_VAULT}}" --query "value" -o tsv)
echo "::add-mask::$SLACK_WEBHOOK"
echo "SLACK_WEBHOOK=$SLACK_WEBHOOK" >> $GITHUB_OUTPUT
- name: Deploy to Development
uses: ./.github/workflows/actions/deploy
id: deploy
- name: Deploy to Development AKS
uses: ./.github/workflows/actions/deploy_v2
id: deploy_v2
with:
environment: Development
environment: development_aks
sha: ${{ github.sha }}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
KEY_VAULT: ${{ secrets.KEY_VAULT }}
Expand Down Expand Up @@ -574,97 +580,6 @@ jobs:
RELEASE_ID: ${{ steps.release.outputs.id }}
TOKEN: ${{secrets.GITHUB_TOKEN}}

development_aks:
name: Development AKS Deployment
needs: [ feature_tests, javascript_tests, build_release ]
if: github.ref == 'refs/heads/master'
concurrency: Development_aks
continue-on-error: true
runs-on: ubuntu-latest
environment:
name: development_aks
outputs:
release_tag: ${{steps.tag_version.outputs.pr_number}}
release_sha: ${{github.sha }}
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: set-up-environment
uses: DFE-Digital/github-actions/set-up-environment@master
with:
var_file: .github/common_environment_aks.yml

- uses: Azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Fetch secrets from key vault
uses: azure/CLI@v1
id: keyvault-yaml-secret
with:
inlineScript: |
SLACK_WEBHOOK=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.KEY_VAULT}}" --query "value" -o tsv)
echo "::add-mask::$SLACK_WEBHOOK"
echo "SLACK_WEBHOOK=$SLACK_WEBHOOK" >> $GITHUB_OUTPUT
- name: Deploy to Development AKS
uses: ./.github/workflows/actions/deploy_v2
id: deploy_v2
with:
environment: development_aks
sha: ${{ github.sha }}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
KEY_VAULT: ${{ secrets.KEY_VAULT }}
ARM_ACCESS_KEY: ${{ secrets.ARM_ACCESS_KEY }}

# Uncomment below when PaaS dev deploy step is removed

# - name: Generate Tag from PR Number
# id: tag_version
# uses: DFE-Digital/github-actions/GenerateReleaseFromSHA@master
# with:
# sha: ${{github.sha}}

# - name: Create a GitHub Release
# id: release
# if: steps.tag_version.outputs.pr_found == 1
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ steps.tag_version.outputs.pr_number }}
# body: ${{ steps.tag_version.outputs.pr_number }}
# release_name: Release ${{ steps.tag_version.outputs.pr_number }}
# commitish: ${{ github.sha}}
# prerelease: false

# - name: Copy PR Info to Release
# if: steps.release.outputs.id
# uses: DFE-Digital/github-actions/CopyPRtoRelease@master
# with:
# PR_NUMBER: ${{ steps.tag_version.outputs.pr_number }}
# RELEASE_ID: ${{ steps.release.outputs.id }}
# TOKEN: ${{secrets.GITHUB_TOKEN}}

owasp:
name: OWASP Checks
needs: [ development ]
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Vunerability Test
uses: ./.github/workflows/actions/owasp
id: deploy
with:
environment: Development
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
KEY_VAULT: ${{ secrets.KEY_VAULT }}
ARM_ACCESS_KEY: ${{ secrets.ARM_ACCESS_KEY }}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

owasp_aks:
name: OWASP AKS Checks
needs: [ development_aks ]
Expand Down Expand Up @@ -900,7 +815,7 @@ jobs:
production:
name: Production Deployment
runs-on: ubuntu-latest
needs: [ integration, development ]
needs: [ integration, development_aks ]
concurrency: Production
environment:
name: Production
Expand Down

0 comments on commit 575f85a

Please sign in to comment.