Merge pull request #309 from nationalarchives/add-run-name-to-deploy-… #228
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tag and pre deploy | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
pre-deploy: | |
runs-on: ubuntu-latest | |
environment: intg | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-ecosystem/[email protected] | |
id: get-latest-tag | |
- uses: actions-ecosystem/action-bump-semver@v1 | |
id: bump-semver | |
with: | |
current_version: ${{ steps.get-latest-tag.outputs.tag }} | |
level: patch | |
- uses: actions-ecosystem/action-push-tag@v1 | |
with: | |
tag: ${{ steps.bump-semver.outputs.new_version }} | |
message: '${{ steps.bump-semver.outputs.new_version }}' | |
- name: Configure AWS credentials from management account | |
uses: aws-actions/configure-aws-credentials@v1-node16 | |
with: | |
role-to-assume: arn:aws:iam::${{ secrets.MANAGEMENT_ACCOUNT }}:role/TDRGithubActionsRoleMgmt | |
aws-region: eu-west-2 | |
role-session-name: APIDownloadDependencies | |
- name: Build jar file | |
run: sbt assembly | |
- name: Build new image version | |
env: | |
GITHUB_TOKEN: ${{ secrets.WORKFLOW_PAT }} | |
run: | | |
aws s3 cp target/scala-2.13/keycloak-user-management.jar s3://tdr-backend-code-mgmt/${{ steps.bump-semver.outputs.new_version }}/keycloak-user-management.jar | |
gh release create ${{ steps.bump-semver.outputs.new_version }} target/scala-2.13/keycloak-user-management.jar | |
- name: Deploy to integration | |
run: gh workflow run deploy.yml -f environment=intg -f toDeploy=${{ steps.bump-semver.outputs.new_version }} -r main | |
env: | |
GITHUB_TOKEN: ${{ secrets.WORKFLOW_PAT }} |