build-and-release-impl #6
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: build-and-release-impl | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
release: | |
runs-on: self-hosted | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Set Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: 7.4.2 | |
- name: Set env vars from AWS params | |
uses: cmsgov/ab2d-bcda-dpc-platform/actions/aws-params-env-action@main | |
env: | |
AWS_REGION: ${{ vars.AWS_REGION }} | |
with: | |
params: | | |
ARTIFACTORY_URL=/artifactory/url | |
ARTIFACTORY_USER=/artifactory/user | |
ARTIFACTORY_PASSWORD=/artifactory/password | |
SONAR_HOST_URL=/sonarqube/url | |
SONAR_TOKEN=/sonarqube/token | |
- name: Build Libraries | |
run: | | |
gradle -b build.gradle bootJar -Dset.root.project.build.filename=true | |
- name: Assume role in target account | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: arn:aws:iam::${{ vars.IMPL_ACCOUNT_NUMBER }}:role/delegatedadmin/developer/github-actions-runner-role | |
- name: Build Docker Image | |
env: | |
ACCOUNT_NUMBER: ${{ vars.IMPL_ACCOUNT_NUMBER }} | |
ECR_REPO_ENV: "ab2d-impl-services" | |
AWS_REGION: "us-east-1" | |
run: ./scripts/github-actions-build-docker-image.sh | |
- name: release to ecs | |
env: | |
DEPLOYMENT_ENV: "ab2d-east-impl" | |
AWS_REGION: "us-east-1" | |
run: ./scripts/github-actions-release.sh |