forked from SoarinFerret/bitnami-postgres-pgvecto-rs
-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (36 loc) · 1.13 KB
/
docker-build.yaml
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
# Main Workflow for Building & Publishing Github Containers to ghcr.io
name: Docker Build & Publish to GitHub Container Registry
on:
push:
tags:
- 'pg*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-docker-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and Push Versioned Docker Image
id: build-and-push
uses: docker/build-push-action@v6
if: ${{ github.ref != 'refs/heads/main' }}
with:
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}