This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
61 lines (52 loc) · 1.83 KB
/
docker.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
53
54
55
56
57
58
59
60
61
name: Docker
on:
push:
branches: [ 'main']
pull_request:
#temp until we docker build is resolved
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
strategy:
fail-fast: false
matrix:
runner: [ "X64", "arm-runner" ]
name: "update: build and deploy postgres server images"
runs-on: [ self-hosted, "${{ matrix.runner }}" ]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
with:
fetch-depth: 0
- name: Build images
run: |
nix build .#psql_15/docker -o result-docker-15
nix build .#psql_16/docker -o result-docker-16
nix build .#psql_orioledb_16/docker -o result-docker-orioledb-16
- name: Tag images
run: |
set -x
for x in 15 16 orioledb-16; do
docker load -i result-docker-$x
docker tag postgresql-$x:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-$x:${GITHUB_SHA}
docker tag postgresql-$x:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-$x:latest
done
- name: Log in to the Container registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image to the Container registry
run: |
set -x
for x in 15 16 orioledb-16; do
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-$x:${GITHUB_SHA}
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-$x:latest
done