Skip to content

Commit cff855e

Browse files
committed
Change container publishing from Docker Hub to GitHub Container Registry
1 parent 9c5e3f5 commit cff855e

File tree

2 files changed

+34
-42
lines changed

2 files changed

+34
-42
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Docker Build and Push
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
7+
jobs:
8+
build:
9+
name: Build and push to GitHub Container Registry
10+
runs-on: ubuntu-22.04
11+
permissions:
12+
contents: read
13+
packages: write
14+
steps:
15+
- name: Set VERSION and TAG
16+
run: |
17+
echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
18+
echo "VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
19+
20+
- uses: actions/checkout@v4
21+
22+
- name: Login to GitHub Container Registry
23+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.repository_owner }}" --password-stdin
24+
25+
- name: Setup Docker buildx
26+
run: docker buildx create --use
27+
28+
- name: Run Docker buildx
29+
run: |
30+
docker buildx build \
31+
--platform linux/amd64,linux/arm64 \
32+
--build-arg VERSION=${{ env.VERSION }} \
33+
--tag ghcr.io/${{ github.repository }}:${{ env.TAG }} \
34+
--push .

.github/workflows/publish-on-tag.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)