Skip to content

build

build #25

Workflow file for this run

name: build
on:
create:
tags:
- v*
jobs:
build:
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#standard-github-hosted-runners-for-public-repositories
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: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: true
tags: 'gitsang/ddns:latest, gitsang/ddns:${{ steps.get_version.outputs.VERSION }}'
platforms: linux/amd64, linux/arm64, linux/arm/v7
build-args: VERSION=${{ steps.get_version.outputs.VERSION }}