2024-09-17 11:53:11 +00:00
|
|
|
name: Create postgresql docker image
|
|
|
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
|
|
|
on:
|
|
|
|
push:
|
2024-09-17 12:16:33 +00:00
|
|
|
branches:
|
|
|
|
- main
|
2024-09-17 11:53:11 +00:00
|
|
|
paths:
|
|
|
|
- '*Dockerfile-cloudnative-pg'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
Explore-Gitea-Actions:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
REGISTRY: registry.tuxnet.lan
|
|
|
|
IMAGE: db/postgresql
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
|
|
|
|
- name: Set up Docker BuildX
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
with: # replace it with your local IP
|
|
|
|
config-inline: |
|
|
|
|
[registry."registry.tuxnet.lan"]
|
|
|
|
http = true
|
|
|
|
insecure = true
|
|
|
|
|
|
|
|
- name: Set Docker Version
|
|
|
|
id: get_version
|
|
|
|
run: |
|
2024-09-17 11:57:14 +00:00
|
|
|
DOCKER_VERSION=$(grep -oP '(?<=^FROM ghcr.io/cloudnative-pg/postgresql:).*' Dockerfile-cloudnative-pg)
|
2024-09-17 11:53:11 +00:00
|
|
|
echo "Docker version: $DOCKER_VERSION"
|
|
|
|
echo "::set-output name=tag::$DOCKER_VERSION"
|
|
|
|
|
|
|
|
- name: Build and push
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile-postgresql
|
|
|
|
platforms: |
|
|
|
|
linux/amd64
|
|
|
|
push: true
|
2024-09-17 11:57:14 +00:00
|
|
|
tags: ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.get_version.outputs.tag }}-cloudnative
|