removed old code path #27
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
| name: DEA Burn Severity App Image Push | |
| env: | |
| IMAGE_NAME: geoscienceaustralia/dea-burn-severity | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'src/**' | |
| - 'tests/**' | |
| - '!configs/*' | |
| - 'Dockerfile' | |
| - 'constraints.txt' | |
| - 'requirements.txt' | |
| - 'pyproject.toml' | |
| - '.github/workflows/dea-burn-severity-image.yaml' | |
| release: | |
| types: [created, edited] | |
| permissions: | |
| id-token: write # This is required for requesting the JWT | |
| contents: read # This is required for actions/checkout | |
| jobs: | |
| push_ecr: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Run unit tests (Docker build executes pytest) | |
| run: | | |
| docker build -t dea-burn-severity:test --progress=plain . | |
| docker rmi dea-burn-severity:test || true | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME_BURN_SEVERITY }} | |
| audience: sts.amazonaws.com | |
| aws-region: ap-southeast-2 | |
| - name: Set default RELEASE tag if not set | |
| run: | | |
| if [ -z "${GITHUB_REF##refs/tags/*}" ]; then | |
| echo "RELEASE=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV | |
| else | |
| echo "RELEASE=latest" >> $GITHUB_ENV | |
| fi | |
| - name: Push release image to ECR | |
| uses: whoan/docker-build-with-cache-action@master | |
| if: github.event_name == 'release' | |
| with: | |
| registry: 538673716275.dkr.ecr.ap-southeast-2.amazonaws.com | |
| image_name: ${{ env.IMAGE_NAME }} | |
| image_tag: ${{ env.RELEASE }} | |
| - name: Get git commit hash for push to main | |
| if: github.event_name != 'release' | |
| run: | | |
| echo "TAG=dev$(git rev-parse --short HEAD)" \ | |
| >> $GITHUB_ENV | |
| - name: Push unstable image to ECR | |
| uses: whoan/docker-build-with-cache-action@master | |
| if: github.event_name != 'release' | |
| with: | |
| registry: 538673716275.dkr.ecr.ap-southeast-2.amazonaws.com | |
| image_name: ${{ env.IMAGE_NAME }} | |
| image_tag: latest,${{ env.TAG }} |