Skip to content

fix release

fix release #2

Workflow file for this run

---
name: Release
on: [push]
jobs:
release:
runs-on: ubuntu-22.04
permissions:
packages: write
contents: read
env:
CONTAINER_REGISTRY: ghcr.io/pyar6329/postgres
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Github Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Test Building Dockerfile
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./Dockerfile
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Get Docker image tag for Release
id: release_tag
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "tag=${GITHUB_REF:10}" >> $GITHUB_OUTPUT
- name: Build PostgreSQL image and push it to GItHub Container Registry
uses: docker/build-push-action@v5
if: startsWith(github.ref, 'refs/tags/')
env:
IMAGE_TAG: release-${{ steps.release_tag.outputs.tag }}
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./Dockerfile
push: true
tags: |
${{ env.CONTAINER_REGISTRY }}:${{ env.IMAGE_TAG }}
${{ env.CONTAINER_REGISTRY }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max