Skip to content

postgres

postgres #6

Workflow file for this run

name: postgres
on:
schedule:
- cron: '0 0 1 * *'
workflow_dispatch:
env:
BUILD_VERSION: "16-alpine"
DOCKER_CLI_EXPERIMENTAL: enabled
REPOSITORY: tgdrive/${{ github.workflow }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Docker metadata
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REPOSITORY }}
labels: |
org.opencontainers.image.version=${{ env.BUILD_VERSION }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.title=${{ env.REPOSITORY }}
- name: Build Image
uses: docker/build-push-action@v6
with:
context: ./postgres
push: true
platforms: linux/amd64,linux/arm64
build-args: |
BUILD_VERSION
labels: ${{ steps.docker_meta.outputs.labels }}
sbom: true
provenance: true
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}
tags: |
ghcr.io/${{ env.REPOSITORY }}:${{ env.BUILD_VERSION }}
ghcr.io/${{ env.REPOSITORY }}:latest