Skip to content

chore(deps): update docker/build-push-action action to v6 #236

chore(deps): update docker/build-push-action action to v6

chore(deps): update docker/build-push-action action to v6 #236

Workflow file for this run

name: Build docker action
on:
push:
tags:
- 'v*'
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Test
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: 'action-notify-on-change/go.mod'
cache-dependency-path: 'action-notify-on-change/go.sum'
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
working-directory: action-notify-on-change
- name: Verify
working-directory: ./action-notify-on-change
run: go mod verify
- name: Test
working-directory: ./action-notify-on-change
run: go test -v ./...
docker:
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/cresta/action-notify-on-change
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
v1
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: action-notify-on-change
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max