Skip to content

chore: add gormlint and useany testdata directories to dependency dow… #9

chore: add gormlint and useany testdata directories to dependency dow…

chore: add gormlint and useany testdata directories to dependency dow… #9

Workflow file for this run

name: Build and Push Docker Image to AWS ECR Public
on:
push:
tags:
- 'v*.*.*' # Triggers on semantic version tags like v1.0.0
- 'v*.*.*-*' # Supports pre-release versions like v1.0.0-alpha.1
release:
types: [published] # Triggers when a release is published
permissions:
contents: read
id-token: write # Required for AWS OIDC authentication
env:
REGISTRY_ALIAS: qor5
REPOSITORY: linter
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
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:
role-to-assume: arn:aws:iam::475867236237:role/qor5-test-github-actions-build-public-images
aws-region: us-east-1 # ECR Public is only available in us-east-1
- name: Login to Amazon ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- name: Build, tag, and push docker image to Amazon ECR Public
env:
REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
REGISTRY_ALIAS: ${{ env.REGISTRY_ALIAS }}
REPOSITORY: ${{ env.REPOSITORY }}
IMAGE_TAG: ${{ github.ref_name }} # Use tag name as image tag
run: |
# Build and tag with version tag
docker build -f .docker/Dockerfile -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
# Also tag as latest for release versions (not pre-release)
if [[ "$IMAGE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
docker tag $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:latest
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:latest
echo "✅ Pushed latest tag for release version $IMAGE_TAG"
else
echo "ℹ️ Skipped latest tag for pre-release version $IMAGE_TAG"
fi