forked from zalando/spilo
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.56 KB
/
Copy pathfp-release.yaml
File metadata and controls
54 lines (46 loc) · 1.56 KB
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
name: FP Build and Push Tagged Image
on:
push:
tags:
- '**' # Push events to every tag including hierarchical tags like v1.0/beta
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build_and_push:
runs-on: ubuntu-22.04
name: Build and push with tag name
steps:
- uses: actions/checkout@v4
- name: Extract Tag Name
id: extract_tag
run: |
echo "TAG_NAME=$(echo ${{ github.ref }} | cut -d'/' -f3)" >> $GITHUB_ENV
- name: Set up packages
run: sudo apt-get install -y docker-compose
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Derive spilo image name
id: image
working-directory: postgres-appliance
run: |
PGVERSION=$(sed -n 's/^ARG PGVERSION=\([0-9][0-9]*\).*$/\1/p' Dockerfile)
IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-$PGVERSION:${TAG_NAME}"
echo "NAME=$IMAGE" >> "$GITHUB_OUTPUT"
- name: Build and push (linux/amd64)
uses: docker/build-push-action@v6
with:
context: postgres-appliance/
push: true
tags: ${{ steps.image.outputs.NAME }}
platforms: linux/amd64