Merge pull request #19 from ga4gh/dc-iss-17-persona-researcher-design #34
This file contains hidden or 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
| # this workflow is triggered when a PR to the develop branch is merged. | |
| # the following steps are performed: | |
| # - build docker image and push to ECR (image tag is the git describe output as well as 'latest') | |
| # - deploy image to staging environment | |
| name: develop branch workflow | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| - main # temporary until we get a "develop" branch set up | |
| - ci-github-actions # temporary branch for testing, to be removed once workflow is verified | |
| permissions: | |
| id-token: write | |
| jobs: | |
| build-push-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| id: checkout-code | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: save command output | |
| id: save-command-output | |
| run: | | |
| echo "DOCKER_REPO=analytics-dashboard-ui" >> $GITHUB_ENV | |
| echo "DOCKER_TAG=$(git describe)" >> $GITHUB_ENV | |
| - name: build docker image | |
| id: build-docker-image | |
| run: docker build -t ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }} -t ${{ env.DOCKER_REPO }}:latest -t ${{ env.DOCKER_REPO }}:develop . | |
| - name: configure aws credentials | |
| id: configure-aws-credentials | |
| uses: aws-actions/configure-aws-credentials@v6.1.0 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
| aws-region: ${{ secrets.AWS_REGION }} | |
| - name: push to ecr | |
| id: push-to-ecr | |
| uses: jwalton/gh-ecr-push@v2 | |
| with: | |
| region: ${{ secrets.AWS_REGION }} | |
| local-image: ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }} | |
| image: ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }}, ${{ env.DOCKER_REPO }}:latest, ${{ env.DOCKER_REPO }}:develop |