Skip to content

build

build #1

Workflow file for this run

name: build
on:
push:
tags: ['v*']
workflow_dispatch:
env:
REGISTRY: ghcr.io
PACKAGE: ${{ github.repository }}
SOPS_VERSION: v3.8.0
AGE_VERSION: v1.1.1
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.PACKAGE }}
labels: |
org.opencontainers.image.description=sops: ${{env.SOPS_VERSION}} age: ${{env.AGE_VERSION}}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: 'Login'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
build-args: |
SOPS_VERSION=${{ env.SOPS_VERSION }}
SOPS_VERSION=${{ env.SOPS_VERSION }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
outputs: "type=image,annotation-index.org.opencontainers.image.description=sops: ${{env.SOPS_VERSION}} age: ${{env.AGE_VERSION}}"
cache-from: type=gha,scope=${{ env.PACKAGE }}
cache-to: type=gha,scope=${{ env.PACKAGE }}