Skip to content

Added Github Workflow to build docker image and publish it #1

Added Github Workflow to build docker image and publish it

Added Github Workflow to build docker image and publish it #1

Workflow file for this run

name: Docker Image CI
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract GitHub tag # strip "v" from release version so this value can be used as tag for docker image
id: extract_tag
run: |
echo "GIT_TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags/v')
- name: Print GitHub tag
run: |
echo "The value of GIT_TAG is: $GIT_TAG"
if: startsWith(github.ref, 'refs/tags/v')
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
tags: |
tess1o/go-tapo-exporter:latest
tess1o/go-tapo-exporter:${{ env.GIT_TAG || github.sha }}