Skip to content

Commit a8ec975

Browse files
authored
Added new version (#48)
1 parent d9800db commit a8ec975

1 file changed

Lines changed: 24 additions & 21 deletions

File tree

.github/workflows/docker.yaml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,25 @@ name: Create Docker Image
22
on:
33
release:
44
types:
5-
- created
6-
5+
- published
76
workflow_dispatch:
87

8+
env:
9+
DOCKER_REPO: ghcr.io/${{ github.repository_owner }}/pgmanager
10+
DOCKER_SOURCE: github.com/${{ github.repository }}
11+
912
jobs:
1013
build:
1114
name: Build
1215
strategy:
1316
matrix:
1417
arch: [amd64, arm64]
1518
runs-on:
16-
- ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || matrix.arch }}
19+
${{ matrix.arch == 'amd64' && 'ubuntu-24.04' || matrix.arch == 'arm64'
20+
&& 'ubuntu-24.04-arm' }}
1721
env:
1822
OS: linux
1923
ARCH: ${{ matrix.arch }}
20-
DOCKER_REPO: ghcr.io/${{ github.repository_owner }}/pgmanager
21-
DOCKER_SOURCE: https://github.com/${{ github.repository }}
2224
outputs:
2325
tag: ${{ steps.build.outputs.tag }}
2426
permissions:
@@ -27,19 +29,19 @@ jobs:
2729
steps:
2830
- name: Install build tools
2931
run: |
30-
sudo apt-get update -y
31-
sudo apt-get install -y build-essential
32+
sudo apt -y update
33+
sudo apt -y install build-essential git
3234
git config --global advice.detachedHead false
3335
- name: Checkout
34-
uses: actions/checkout@v4
36+
uses: actions/checkout@v6
3537
with:
3638
fetch-depth: 0
37-
fetch-tags: true
39+
submodules: recursive
3840
- name: Login
39-
uses: docker/login-action@v3
41+
uses: docker/login-action@v4
4042
with:
4143
registry: ghcr.io
42-
username: ${{ github.repository_owner }}
44+
username: ${{ github.actor }}
4345
password: ${{ secrets.GITHUB_TOKEN }}
4446
- name: Build and Push
4547
id: build
@@ -58,23 +60,24 @@ jobs:
5860
packages: write
5961
steps:
6062
- name: Login
61-
uses: docker/login-action@v3
63+
uses: docker/login-action@v4
6264
with:
6365
registry: ghcr.io
64-
username: ${{ github.repository_owner }}
66+
username: ${{ github.actor }}
6567
password: ${{ secrets.GITHUB_TOKEN }}
6668
- name: Create
6769
run: |
68-
docker manifest create ghcr.io/${{ github.repository_owner }}/pgmanager:${{ matrix.tag }} \
69-
--amend ghcr.io/${{ github.repository_owner }}/pgmanager-linux-amd64:${{ needs.build.outputs.tag }} \
70-
--amend ghcr.io/${{ github.repository_owner }}/pgmanager-linux-arm64:${{ needs.build.outputs.tag }}
70+
docker manifest create ${DOCKER_REPO}:${{ matrix.tag }} \
71+
--amend ${DOCKER_REPO}-linux-amd64:${{ needs.build.outputs.tag }} \
72+
--amend ${DOCKER_REPO}-linux-arm64:${{ needs.build.outputs.tag }}
7173
- name: Annotate
7274
run: |
7375
docker manifest annotate --arch amd64 --os linux \
74-
ghcr.io/${{ github.repository_owner }}/pgmanager:${{ matrix.tag }} \
75-
ghcr.io/${{ github.repository_owner }}/pgmanager-linux-amd64:${{ needs.build.outputs.tag }}
76+
${DOCKER_REPO}:${{ matrix.tag }} \
77+
${DOCKER_REPO}-linux-amd64:${{ needs.build.outputs.tag }}
7678
docker manifest annotate --arch arm64 --os linux \
77-
ghcr.io/${{ github.repository_owner }}/pgmanager:${{ matrix.tag }} \
78-
ghcr.io/${{ github.repository_owner }}/pgmanager-linux-arm64:${{ needs.build.outputs.tag }}
79+
${DOCKER_REPO}:${{ matrix.tag }} \
80+
${DOCKER_REPO}-linux-arm64:${{ needs.build.outputs.tag }}
7981
- name: Push
80-
run: docker manifest push ghcr.io/${{ github.repository_owner }}/pgmanager:${{ matrix.tag }}
82+
run: |
83+
docker manifest push ${DOCKER_REPO}:${{ matrix.tag }}

0 commit comments

Comments
 (0)