Skip to content

Add GitHub Actions workflows #7

Add GitHub Actions workflows

Add GitHub Actions workflows #7

Workflow file for this run

name: "docker build and push"
on:
pull_request:
paths:
- .github/workflows/docker.yml
- proto/**.proto
- src/**
- Cargo.toml
- Cargo.lock
push:
tags:
- '*'
env:
PUBLISH: ${{ github.ref_type == 'tags' }}
jobs:
docker_build:
runs-on: ubuntu-latest
steps:
- name: check publish
run: echo '${{ env.PUBLISH }}'
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
if: ${{ env.PUBLISH == 'true' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: docker/build-push-action@v6
with:
context: .
push: ${{ env.PUBLISH == 'true' }}
tags: saint1991/gduck:${{ env.PUBLISH == 'true' && github.ref_name || 'latest' }}