Merge pull request #81 from supabase-community/upgrade-202311 #40
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: ecr-publish | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: {} | |
env: | |
ECR_PUBLIC_ALIAS: u3p7q2r8 | |
jobs: | |
kong: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # needed to interact with GitHub's OIDC Token endpoint. | |
contents: read | |
env: | |
IMAGE_NAME: kong | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: technote-space/get-diff-action@v6 | |
with: | |
PATTERNS: | | |
containers/kong/**/* | |
.github/workflows/ecr-publish.yml | |
- name: Set up QEMU | |
if: env.GIT_DIFF | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
if: env.GIT_DIFF | |
uses: docker/setup-buildx-action@v3 | |
- name: Configure AWS credentials | |
if: env.GIT_DIFF | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.ECR_PUBLIC_ROLE }} | |
aws-region: us-east-1 | |
- name: Login to Amazon ECR Public | |
id: login-ecr-public | |
if: env.GIT_DIFF | |
uses: aws-actions/amazon-ecr-login@v2 | |
with: | |
registry-type: public | |
- name: Build and push | |
if: env.GIT_DIFF | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./containers/kong | |
file: ./containers/kong/Dockerfile | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ steps.login-ecr-public.outputs.registry }}/${{ env.ECR_PUBLIC_ALIAS }}/${{ env.IMAGE_NAME }}:latest | |
postgraphile: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # needed to interact with GitHub's OIDC Token endpoint. | |
contents: read | |
env: | |
IMAGE_NAME: postgraphile | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: technote-space/get-diff-action@v6 | |
with: | |
PATTERNS: | | |
containers/postgraphile/**/* | |
.github/workflows/ecr-publish.yml | |
- name: Set up QEMU | |
if: env.GIT_DIFF | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
if: env.GIT_DIFF | |
uses: docker/setup-buildx-action@v3 | |
- name: Configure AWS credentials | |
if: env.GIT_DIFF | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.ECR_PUBLIC_ROLE }} | |
aws-region: us-east-1 | |
- name: Login to Amazon ECR Public | |
id: login-ecr-public | |
if: env.GIT_DIFF | |
uses: aws-actions/amazon-ecr-login@v2 | |
with: | |
registry-type: public | |
- name: Build and push | |
if: env.GIT_DIFF | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./containers/postgraphile | |
file: ./containers/postgraphile/Dockerfile | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
${{ steps.login-ecr-public.outputs.registry }}/${{ env.ECR_PUBLIC_ALIAS }}/${{ env.IMAGE_NAME }}:latest | |
${{ steps.login-ecr-public.outputs.registry }}/${{ env.ECR_PUBLIC_ALIAS }}/${{ env.IMAGE_NAME }}:4 |