Skip to content

Postgres

Postgres #1

# This workflow will build a Docker image and push it to GitHub Container Registry
name: Publish Docker image
on:
workflow_dispatch:
pull_request:
branches:
- main
jobs:
push_to_registries:
name: Push Docker image to ghcr.io
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/[email protected]
with:
install: true
driver-opts: network=host
platforms: linux/amd64,linux/arm64
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
- name: Build and push Docker images
id: push
uses: docker/[email protected]
with:
context: .
file: Dockerfile.prod
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}:prod
platforms: linux/amd64,linux/arm64