Skip to content

chore: switch to goreleaser's v2_docker images #245

chore: switch to goreleaser's v2_docker images

chore: switch to goreleaser's v2_docker images #245

Workflow file for this run

name: hostlookuper
on:
pull_request:
push:
permissions:
contents: write
packages: write
jobs:
check-dockerhub-token:
runs-on: ubuntu-latest
outputs:
HAS_DOCKERHUB_TOKEN: ${{ steps.dockerhub-token.outputs.HAS_DOCKERHUB_TOKEN }}
steps:
- id: dockerhub-token
env:
HAS_DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN != '' }}
run: |
echo "HAS_DOCKERHUB_TOKEN=$HAS_DOCKERHUB_TOKEN" >> $GITHUB_OUTPUT
echo "HAS_DOCKERHUB_TOKEN=$HAS_DOCKERHUB_TOKEN" >> $GITHUB_STEP_SUMMARY
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: 1.24
- name: Install golangci-lint
uses: golangci/golangci-lint-action@main
build:
needs:
- lint
- check-dockerhub-token
if: |
!startsWith(github.ref, 'refs/tags/v') &&
needs.check-dockerhub-token.outputs.HAS_DOCKERHUB_TOKEN == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 1.24
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: latest
args: release --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
needs:
- lint
- check-dockerhub-token
if: |
startsWith(github.ref, 'refs/tags/v') &&
needs.check-dockerhub-token.outputs.HAS_DOCKERHUB_TOKEN == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 1.24
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}