Merge pull request #176 from squarescale/fix-lb-commands #36
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
name: Release | |
on: | |
push: | |
tags: | |
- v*.*.* | |
workflow_dispatch: | |
jobs: | |
test: | |
uses: ./.github/workflows/test.yml | |
release: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '>=1.20.0' | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- run: git fetch --force --tags | |
- name: Run goreleaser | |
uses: goreleaser/goreleaser-action@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
args: release --rm-dist | |
version: latest | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build binary for Docker | |
run: make docker-alpine-amd64 | |
- name: Build gh-actions | |
run: make build-gh-actions | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Extract Github branch | |
id: get_branch | |
run: echo ::set-output name=GIT_BRANCH::${GITHUB_REF##*/} | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
repository: squarescale/cli | |
tag_with_ref: true | |
tag_with_sha: true | |
tags: | | |
squarescale/cli:${{ steps.get_branch.outputs.GIT_BRANCH }} | |
squarescale/cli:latest |