Skip to content

release

release #59

Workflow file for this run

name: release
on:
push:
tags:
- 'bq2bq/v*'
- 'mc2mc/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
mc2mc:
if: startsWith(github.ref, 'refs/tags/mc2mc/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 mc2mc
mkdir build
go get .
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./build/mc2mc .
- 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/mc2mc/v' prefix
TAG="${GITHUB_REF#refs/tags/mc2mc/}"
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: ./mc2mc
platforms: linux/amd64 # Specify the target platforms
push: true
tags: |
docker.io/gotocompany/mc2mc:latest
docker.io/gotocompany/mc2mc:${{ steps.vars.outputs.tag }}
- name: Log out from Docker Hub
run: docker logout