Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 24 additions & 21 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@ name: Create Docker Image
on:
release:
types:
- created

- published
workflow_dispatch:

env:
DOCKER_REPO: ghcr.io/${{ github.repository_owner }}/pgmanager
DOCKER_SOURCE: github.com/${{ github.repository }}
Comment on lines +9 to +10

jobs:
build:
name: Build
strategy:
matrix:
arch: [amd64, arm64]
runs-on:
- ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || matrix.arch }}
${{ matrix.arch == 'amd64' && 'ubuntu-24.04' || matrix.arch == 'arm64'
&& 'ubuntu-24.04-arm' }}
Comment on lines 18 to +20
env:
OS: linux
ARCH: ${{ matrix.arch }}
DOCKER_REPO: ghcr.io/${{ github.repository_owner }}/pgmanager
DOCKER_SOURCE: https://github.com/${{ github.repository }}
outputs:
tag: ${{ steps.build.outputs.tag }}
permissions:
Expand All @@ -27,19 +29,19 @@ jobs:
steps:
- name: Install build tools
run: |
sudo apt-get update -y
sudo apt-get install -y build-essential
sudo apt -y update
sudo apt -y install build-essential git
Comment on lines +32 to +33
git config --global advice.detachedHead false
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
submodules: recursive
- name: Login
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
id: build
Expand All @@ -58,23 +60,24 @@ jobs:
packages: write
steps:
- name: Login
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create
run: |
docker manifest create ghcr.io/${{ github.repository_owner }}/pgmanager:${{ matrix.tag }} \
--amend ghcr.io/${{ github.repository_owner }}/pgmanager-linux-amd64:${{ needs.build.outputs.tag }} \
--amend ghcr.io/${{ github.repository_owner }}/pgmanager-linux-arm64:${{ needs.build.outputs.tag }}
docker manifest create ${DOCKER_REPO}:${{ matrix.tag }} \
--amend ${DOCKER_REPO}-linux-amd64:${{ needs.build.outputs.tag }} \
--amend ${DOCKER_REPO}-linux-arm64:${{ needs.build.outputs.tag }}
- name: Annotate
run: |
docker manifest annotate --arch amd64 --os linux \
ghcr.io/${{ github.repository_owner }}/pgmanager:${{ matrix.tag }} \
ghcr.io/${{ github.repository_owner }}/pgmanager-linux-amd64:${{ needs.build.outputs.tag }}
${DOCKER_REPO}:${{ matrix.tag }} \
${DOCKER_REPO}-linux-amd64:${{ needs.build.outputs.tag }}
docker manifest annotate --arch arm64 --os linux \
ghcr.io/${{ github.repository_owner }}/pgmanager:${{ matrix.tag }} \
ghcr.io/${{ github.repository_owner }}/pgmanager-linux-arm64:${{ needs.build.outputs.tag }}
${DOCKER_REPO}:${{ matrix.tag }} \
${DOCKER_REPO}-linux-arm64:${{ needs.build.outputs.tag }}
- name: Push
run: docker manifest push ghcr.io/${{ github.repository_owner }}/pgmanager:${{ matrix.tag }}
run: |
docker manifest push ${DOCKER_REPO}:${{ matrix.tag }}
Loading