Skip to content

Added workflow to push to docker registry, updated README.md and fixe… #2

Added workflow to push to docker registry, updated README.md and fixe…

Added workflow to push to docker registry, updated README.md and fixe… #2

Workflow file for this run

name: goreleaser
on:
push:
tags:
- '*'
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dockerize-and-push:
runs-on: ubuntu-latest
needs: goreleaser
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
target: final
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/gtfocli:latest
${{ secrets.DOCKERHUB_USERNAME }}/gtfocli:${{ github.ref_name }}