fix: get slack channel id from config #76
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 Push Docker Images | |
on: | |
release: | |
types: [published] | |
push: | |
tags: [v*] | |
branches: [main] | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-region: eu-central-1 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Get short SHA | |
id: get_sha | |
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- name: Get tag name or SHA | |
id: get_tag | |
run: | | |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
echo "GIT_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
else | |
echo "GIT_TAG=${{ env.SHORT_SHA }}" >> $GITHUB_ENV | |
fi | |
- name: Build and push requester image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: src/docker/Dockerfile.requester | |
push: true | |
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-central-1.amazonaws.com/aws-sso-elevator:requester-${{ env.GIT_TAG }} | |
provenance: false | |
- name: Build and push revoker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: src/docker/Dockerfile.revoker | |
push: true | |
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-central-1.amazonaws.com/aws-sso-elevator:revoker-${{ env.GIT_TAG }} | |
provenance: false |