-
-
Notifications
You must be signed in to change notification settings - Fork 15
52 lines (44 loc) · 1.42 KB
/
docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Build and Push Docker Image
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
workflow_call:
secrets:
DOCKER_USERNAME:
required: true
DOCKER_TOKEN:
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get latest release tag for Babelfish
id: get_babelfish_latest
run: |
BABELFISH_TAG=$(curl -s https://api.github.com/repos/babelfish-for-postgresql/babelfish-for-postgresql/releases/latest | jq -r '.tag_name')
echo "babelfish_tag=$BABELFISH_TAG" >> $GITHUB_OUTPUT
echo "Latest Babelfish release: $BABELFISH_TAG"
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and Push Docker image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
tags: |
jonathanpotts/babelfishpg:${{ steps.get_babelfish_latest.outputs.babelfish_tag }}
jonathanpotts/babelfishpg:latest
build-args:
BABELFISH_VERSION=${{ steps.get_babelfish_latest.outputs.babelfish_tag }}
push: true