8000 Chore/docker ci (#110) · michelp/postgres@3ff1a71 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3ff1a71

Browse files
authored
Chore/docker ci (supabase#110)
1 parent b0b975a commit 3ff1a71

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release on Dockerhub
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
paths:
8+
- docker.vars*
9+
10+
jobs:
11+
docker_release:
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- id: settings
17+
run: |
18+
apt update --yes && apt install --yes jq
19+
DOCKER_VERSION=$(cat docker.vars.json | jq -r '.["docker-version"]')
20+
echo "::set-output name=docker_version::$DOCKER_VERSION"
21+
22+
POSTGRES_VERSION=$(cat docker.vars.json | jq -r '.["postgres-version"]')
23+
echo "::set-output name=postgres_version::$POSTGRES_VERSION"
24+
25+
PLATFORM=$(cat docker.vars.json | jq -r '.["platform"]')
26+
echo "::set-output name=platform::$PLATFORM"
27+
28+
- uses: docker/setup-qemu-action@v1
29+
with:
30+
platforms: amd64,arm64
31+
32+
- uses: docker/setup-buildx-action@v1
33+
34+
- uses: docker/login-action@v1
35+
with:
36+
username: ${{ secrets.DOCKER_USERNAME }}
37+
password: ${{ secrets.DOCKER_PASSWORD }}
38+
39+
- uses: docker/build-push-action@v2
40+
with:
41+
context: .
42+
push: true
43+
tags: supabase/postgres:latest,supabase/postgres:${{ steps.settings.outputs.docker_version }}
44+
platforms: linux/amd64,linux/arm64
45+
build-args: |
46+
"PLATFORM=${{steps.settings.outputs.platform}}"
47+
"VERSION=${{steps.settings.outputs.postgres_version}}"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN apt update && \
1414
apt -y autoremove && \
1515
apt -y autoclean && \
1616
apt install -y default-jdk-headless && \
17-
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*
17+
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*
1818

1919
ENV LANGUAGE=en_US.UTF-8
2020
ENV LANG=en_US.UTF-8

docker.vars.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"docker-version": "14.1.0",
3+
"postgres-version": "14.1",
4+
"platform": "linux/amd64"
5+
}
6+

0 commit comments

Comments
 (0)
0