Skip to content

Merge branch 'main' of https://github.com/xentom/cli #20

Merge branch 'main' of https://github.com/xentom/cli

Merge branch 'main' of https://github.com/xentom/cli #20

Workflow file for this run

name: docker
on:
push:
branches:
- main
tags:
- v*
env:
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/cli
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=canary,enable={{is_default_branch}}
type=match,pattern=v(.*),group=1
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GITHUB_SHA=${{ github.sha }}
GITHUB_REF_TYPE=${{ github.ref_type }}