chore(deps): update tonistiigi/xx docker tag to v1.7.0 (#27) #112
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: Build | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- 'v*.*.*' | |
- 'v*.*' | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v5 | |
- name: Set up Go | |
uses: actions/setup-go@v6 | |
with: | |
go-version-file: go.mod | |
cache: false | |
- name: Lint | |
uses: golangci/golangci-lint-action@v8 | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v5 | |
- name: Set up Go | |
uses: actions/setup-go@v6 | |
with: | |
go-version-file: go.mod | |
- name: Test | |
run: go test ./... | |
build: | |
name: Build Image | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/rmitchellscott/aviary-integration-ses | |
952638226427.dkr.ecr.us-east-2.amazonaws.com/aviary-integration-ses | |
tags: | | |
# branch-based tags (e.g. 'main') | |
type=ref,event=branch | |
# mirror git tag (e.g. 'v1.2.3') | |
type=ref,event=tag | |
# semver without the 'v' (e.g. '1.2.3') | |
type=semver,pattern={{version}} | |
# major.minor (e.g. '1.2') | |
type=semver,pattern={{major}}.{{minor}} | |
# major only (e.g. '1') | |
type=semver,pattern={{major}} | |
# latest on main | |
type=raw,priority=1000,value=latest,enable=${{ github.ref == 'refs/heads/main' }} | |
# commit short SHA | |
type=sha | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v5 | |
with: | |
role-to-assume: arn:aws:iam::952638226427:role/GitHubActionsRole | |
aws-region: us-east-2 | |
- name: Login to Amazon ECR | |
uses: aws-actions/amazon-ecr-login@v2 | |
with: | |
region: us-east-2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Push | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
pull: true | |
push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }} | |
platforms: linux/amd64,linux/arm64/v8 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Extract ARM64 digest | |
id: extract-arm64 | |
run: | | |
ECR_URI=952638226427.dkr.ecr.us-east-2.amazonaws.com/aviary-integration-ses | |
TAG=latest | |
# use buildx imagetools to inspect the manifest list | |
DIGEST=$(docker buildx imagetools inspect $ECR_URI:$TAG --raw \ | |
| jq -r '.manifests[] | select(.platform.architecture=="arm64") | .digest') | |
echo "digest=$DIGEST" >> $GITHUB_OUTPUT | |
- name: Update Lambda to ARM64 image | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
ECR_URI=952638226427.dkr.ecr.us-east-2.amazonaws.com/aviary-integration-ses | |
aws lambda update-function-code \ | |
--function-name aviary-integration-ses \ | |
--image-uri $ECR_URI@${{ steps.extract-arm64.outputs.digest }} |