v0.20.0-rc #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow pushes new Bitsong docker images on every new tag. | |
# | |
# On every new `vX.Y.Z` tag the following images are pushed: | |
# | |
# bitsongofficial/go-bitsong:vX.Y.Z # is pushed | |
# bitsongofficial/go-bitsong:X.Y.Z # is pushed | |
# bitsongofficial/go-bitsong:X.Y # is updated to X.Y.Z | |
# bitsongofficial/go-bitsong:X # is updated to X.Y.Z | |
# bitsongofficial/go-bitsong:latest # is updated to X.Y.Z | |
# | |
# bitsongofficial/go-bitsong-e2e:vX.Y.Z # is pushed | |
# bitsongofficial/go-bitsong-e2e:X.Y.Z # is pushed | |
# bitsongofficial/go-bitsong-e2e:X.Y # is updated to X.Y.Z | |
# bitsongofficial/go-bitsong-e2e:X # is updated to X.Y.Z | |
# bitsongofficial/go-bitsong-e2e:latest # is updated to X.Y.Z | |
# | |
# All the images above have support for linux/amd64 and linux/arm64. | |
name: Push Docker Images | |
env: | |
DOCKER_REPOSITORY: bitsongofficial/go-bitsong | |
RUNNER_BASE_IMAGE_DISTROLESS: gcr.io/distroless/static-debian11 | |
RUNNER_BASE_IMAGE_NONROOT: gcr.io/distroless/static-debian11:nonroot | |
RUNNER_BASE_IMAGE_ALPINE: alpine:3.17 | |
on: | |
release: | |
types: [published, created, edited] | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' # ignore rc | |
jobs: | |
bitsong-images: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Check out the repo | |
uses: actions/checkout@v4 | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Parse tag | |
id: tag | |
run: | | |
VERSION=$(echo ${{ github.ref_name }} | sed "s/v//") | |
MAJOR_VERSION=$(echo $VERSION | cut -d '.' -f 1) | |
MINOR_VERSION=$(echo $VERSION | cut -d '.' -f 2) | |
PATCH_VERSION=$(echo $VERSION | cut -d '.' -f 3) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
echo "MAJOR_VERSION=$MAJOR_VERSION" >> $GITHUB_ENV | |
echo "MINOR_VERSION=$MINOR_VERSION" >> $GITHUB_ENV | |
echo "PATCH_VERSION=$PATCH_VERSION" >> $GITHUB_ENV | |
- | |
name: Build and push | |
id: build_push_image | |
uses: docker/build-push-action@v5 | |
with: | |
file: Dockerfile | |
context: . | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
ghcr.io/bitsongofficial/go-bitsong:${{ env.MAJOR_VERSION }} | |
ghcr.io/bitsongofficial/go-bitsong:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }} | |
ghcr.io/bitsongofficial/go-bitsong:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ env.PATCH_VERSION }} | |
ghcr.io/bitsongofficial/go-bitsong:v${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ env.PATCH_VERSION }} |