Skip to content

Commit

Permalink
Merge pull request #37 from JenswBE/build-on-pull-request
Browse files Browse the repository at this point in the history
Build on PR's
  • Loading branch information
JenswBE committed Oct 11, 2022
2 parents e23cf8c + 7733bbf commit 3b0e509
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/test-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ on:
push:
branches: [main]
tags: ["*"]
pull_request:

env:
GO_VERSION: "^1.18.6" # Also update Dockerfile when bumping
GO_VERSION: "1.18" # Also update Dockerfile when bumping
DOCKER_HUB_USER: jenswbebot
DOCKER_HUB_REPO: jenswbe/dead-link-checker
PLATFORMS: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
Expand All @@ -30,6 +31,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
check-latest: true
go-version: ${{ env.GO_VERSION }}

- name: golangci-lint
Expand Down Expand Up @@ -58,18 +60,22 @@ jobs:
run: go test --tags e2e ./...

- name: Set up QEMU
if: github.event_name == 'push'
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
if: github.event_name == 'push'
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
if: github.event_name == 'push'
uses: docker/login-action@v2
with:
username: ${{ env.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Build and push
if: github.event_name == 'push'
uses: docker/build-push-action@v3
with:
context: .
Expand All @@ -79,6 +85,7 @@ jobs:
tags: ${{ env.DOCKER_HUB_REPO }}:${{ steps.vars.outputs.docker_tag }}

- name: Update repo description
if: github.event_name == 'push'
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ env.DOCKER_HUB_USER }}
Expand Down

0 comments on commit 3b0e509

Please sign in to comment.