forked from raystack/transformers
-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (88 loc) · 2.81 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: release
on:
push:
tags:
- 'bq2bq/v*'
- 'max2max/v*'
jobs:
bq2bq:
if: startsWith(github.ref, 'refs/tags/bq2bq/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Extract the Git tag version
- name: Extract tag version
id: vars
run: |
# Extract the tag name from GITHUB_REF, remove 'refs/tags/bq2bq/v' prefix
TAG="${GITHUB_REF#refs/tags/bq2bq/}"
TAG="${TAG#v}"
echo "Tag name: $TAG"
echo "::set-output name=tag::$TAG"
# Build and push the Docker image to Docker Hub
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./bq2bq
platforms: linux/amd64 # Specify the target platforms
push: true
tags: |
docker.io/gotocompany/optimus-task-bq2bq-executor:latest
docker.io/gotocompany/optimus-task-bq2bq-executor:${{ steps.vars.outputs.tag }}
- name: Log out from Docker Hub
run: docker logout
max2max:
if: startsWith(github.ref, 'refs/tags/max2max/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22
# Build the Go binary
- name: Build
run: |
cd max2max
mkdir build
go get .
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./build/max2max .
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Extract the Git tag version
- name: Extract tag version
id: vars
run: |
# Extract the tag name from GITHUB_REF, remove 'refs/tags/max2max/v' prefix
TAG="${GITHUB_REF#refs/tags/max2max/}"
TAG="${TAG#v}"
echo "Tag name: $TAG"
echo "::set-output name=tag::$TAG"
# Build and push the Docker image to Docker Hub
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./max2max
platforms: linux/amd64 # Specify the target platforms
push: true
tags: |
docker.io/gotocompany/max2max:latest
docker.io/gotocompany/max2max:${{ steps.vars.outputs.tag }}
- name: Log out from Docker Hub
run: docker logout