Skip to content

feat(auth): support multiple Google hosted domains #241

feat(auth): support multiple Google hosted domains

feat(auth): support multiple Google hosted domains #241

Workflow file for this run

name: Release
on:
pull_request_target:
types: [closed]
branches: [main]
permissions:
contents: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
name: Release
if: >
github.event.pull_request.merged == true &&
startsWith(github.event.pull_request.title, 'release: v')
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Tag
id: tag
run: |
if [[ "${{ github.event.pull_request.title }}" =~ ^release:[[:space:]]*v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
TAG="v${BASH_REMATCH[1]}"
echo "tag=${TAG}" >> $GITHUB_OUTPUT
else
echo "PR title must be like 'release: v1.2.3'"
exit 1
fi
git fetch --tags --quiet
if git rev-parse -q --verify "refs/tags/$TAG > /dev/null"; then
echo "Tag $TAG already exists. Aborting..."
exit 1
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -a "$TAG" -m "Automated release $TAG (#${{ github.event.pull_request.number }})"
git push origin "$TAG"
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
- name: Login to AWS ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata for image
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ steps.login-ecr.outputs.registry }}/${{ vars.ECR_LEARNER_REPOSITORY }}
tags: |
type=raw,value=${{ steps.tag.outputs.tag }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: true
platforms: linux/arm64
tags: ${{ steps.metadata.outputs.tags }}
cache-from: type=gha,scope=learner
cache-to: type=gha,mode=max,scope=learner