Skip to content

feat(jzero): add Dockerfile #2

feat(jzero): add Dockerfile

feat(jzero): add Dockerfile #2

Workflow file for this run

name: goreleaser-jzero
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.22.1'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Docker build and push
run: |
# TODO: use buildx to build muti arch
docker build -t jaronnie/jzero:${{ steps.get_version.outputs.VERSION }} .
docker push jaronnie/jzero:${{ steps.get_version.outputs.VERSION }}
docker tag jaronnie/jzero:${{ steps.get_version.outputs.VERSION }} jaronnie/jzero:latest
docker push jaronnie/jzero:latest