Merge pull request #10 from shivjm/release-please/bootstrap/default #66
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and publish to ghcr.io | |
on: | |
- push | |
env: | |
image: ghcr.io/shivjm/helm-kubeconform-action | |
go: "1.19.2" | |
helm: "v3.10.1" | |
schema: "master" | |
kubeconform: "v0.4.14" | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.image }} | |
labels: | | |
tools.helm.version=${{ env.helm }} | |
tools.kubeconform.version=${{ env.kubeconform }} | |
kubernetes.schema.version=${{ env.schema }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern=v{{version}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-args: | | |
GO_VERSION=${{ env.go }} | |
KUBECONFORM_VERSION=${{ env.kubeconform }} | |
HELM_VERSION=${{ env.helm }} | |
SCHEMA_REVISION=${{ env.schema }} | |
labels: ${{ steps.meta.outputs.labels }} | |
tags: ${{ steps.meta.outputs.tags }} | |
push: "${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}" |