Handle empty ldflags (#180) #317
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: Build Docker | |
on: | |
push: | |
branches-ignore: | |
- '*-prebuilt' | |
jobs: | |
build: | |
name: Build & Publish Docker | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set DOCKER_REPO_NAME env | |
run: echo DOCKER_REPO_NAME=$(basename ${GITHUB_REPOSITORY}) >> ${GITHUB_ENV} | |
- name: Set IMAGE_TAG env | |
run: echo IMAGE_TAG=$(basename ${GITHUB_REF}) >> ${GITHUB_ENV} | |
- name: Environment Printer | |
uses: managedkaos/[email protected] | |
- name: Append latest if master branches # env '${IMAGE_TAG},latest' | |
if: endsWith(github.ref, 'master') | |
run: echo IMAGE_TAG=${IMAGE_TAG},master,latest >> ${GITHUB_ENV} | |
- name: Environment Printer | |
uses: managedkaos/[email protected] | |
# Add support for more platforms with QEMU (optional) | |
# https://github.com/docker/setup-qemu-action | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build & Publish to Github Container Registry | |
uses: elgohr/Publish-Docker-Github-Action@v5 | |
with: | |
name: ${{ github.actor }}/${{ env.DOCKER_REPO_NAME }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
platforms: linux/amd64,linux/arm64 | |
registry: ghcr.io | |
snapshot: false | |
tags: "${{ env.IMAGE_TAG }}" | |
- name: Build & Publish to DockerHub | |
uses: elgohr/Publish-Docker-Github-Action@v5 | |
with: | |
name: ${{ github.repository }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
platforms: linux/amd64,linux/arm64 | |
snapshot: false | |
tags: "${{ env.IMAGE_TAG }}" | |