-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1.09 KB
/
publish-docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Publish
on:
release:
types: [published]
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
env:
GITHUB_PACKAGE_TOKEN: ${{ secrets.PKG_TOKEN }}
USERNAME: ${{ github.actor }}
TAG_NAME: ${{ github.event.release.tag_name }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
steps:
- uses: actions/checkout@v3
- name: set up QEMU
uses: docker/setup-qemu-action@v2
- name: set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.OWNER_TOKEN }}
- name: build and deploy image to ghcr.io
run: |
image_name="$(echo ${REGISTRY}/${IMAGE_NAME})"
echo "IMAGE_NAME=${image_name}, VERSION=${TAG_NAME}"
docker buildx build --push \
--platform linux/amd64,linux/arm/v7,linux/arm64 \
-t ${image_name}:${TAG_NAME} -t ${image_name}:latest .