-
Notifications
You must be signed in to change notification settings - Fork 186
52 lines (43 loc) · 1.35 KB
/
cli-docker-release.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
41
42
43
44
45
46
47
48
49
50
51
52
name: CLI Docker Release
on:
workflow_dispatch:
workflow_run:
workflows:
- Mega Releaser
types:
- completed
env:
CARGO_TERM_COLOR: always
jobs:
docker:
name: release docker
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Login Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Derive Version Numbers
run: |
export REPO="${{ secrets.DOCKERHUB_USERNAME }}/svix-cli"
export GIT_TAG="$(git describe --tags --abbrev=0)"
export DOCKER_TAGS=$(echo "${GIT_TAG}" | sed -E "s#v([0-9]+)\.([0-9]+)\.([0-9]+)#${REPO}:latest,${REPO}:v\1.\2.\3,${REPO}:v\1.\2,${REPO}:v\1#")
echo "DOCKER_TAGS=${DOCKER_TAGS}" >> "$GITHUB_ENV"
echo "Generated Tags: ${DOCKER_TAGS}"
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ./
file: ./svix-cli/Dockerfile
push: true
tags: ${{ env.DOCKER_TAGS }}
platforms: linux/amd64,linux/arm64