Skip to content

Use last part of the ref. #3

Use last part of the ref.

Use last part of the ref. #3

Workflow file for this run

name: cd
on:
push:
branches: master
permissions:
contents: write
id-token: write
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
container:
name: Build Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get tag or version
id: gitvars
run: |
echo "##[set-output name=version;]$(echo ${GITHUB_REF##*/})"
- name: Install cosign
uses: sigstore/[email protected]
with:
cosign-release: v2.1.1
- name: Setup Docker buildx
uses: docker/[email protected]
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/[email protected]
with:
images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
tags: |
type=raw,value=${{ steps.gitvars.outputs.version }}
- name: Build and push Docker image
id: build-and-push
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64,linux/arm64
push: 'true'
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max=