Skip to content

fix: fix workflow script #7

fix: fix workflow script

fix: fix workflow script #7

Workflow file for this run

name: docker
on:
create:
tags:
- v*
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Get Version
id: get_version
shell: bash
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Login Docker Hub
uses: docker/login-action@master
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
shell: bash
run: |
NAME=ddns
DIST=dist
VERSION=${{ steps.get_version.outputs.VERSION }}
CGO_ENABLED=0 go build -o ${DIST}/${NAME} ./cmd
- name: Build docker and publish
NAME=ddns
DIST=dist
VERSION=${{ steps.get_version.outputs.VERSION }}
DOCKER_REGISTRY=gitsang
docker buildx build \
--platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 \
--no-cache \
--build-arg DIST=${DIST} \
-t ${DOCKER_REGISTRY}/${NAME}:${VERSION} \
-f Dockerfile \
--push .