Skip to content

ore-cli v2.3.0-1

ore-cli v2.3.0-1 #18

Workflow file for this run

name: Docker CI
on:
release:
types: [published]
paths-ignore:
- 'README.md'
- '.gitignore'
env:
REGISTRY: ghcr.io
jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
image_name: ${{ steps.image_name.outputs.image_name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- id: version
run: |
VERSION=$(cargo metadata --no-deps --quiet --color never | jq -r '.packages[].version')
VERSION_LOWER=$(echo "$VERSION" | tr '[:upper:]' '[:lower:]')
echo "version=${VERSION_LOWER}" >> "$GITHUB_OUTPUT"
- id: image_name
run: |
IMAGE_NAME=$(echo "${{ github.repository_owner }}/ore" | tr '[:upper:]' '[:lower:]')
echo "image_name=${IMAGE_NAME}" >> "$GITHUB_OUTPUT"
build:
needs: version
runs-on: ubuntu-latest
permissions:
contents: read
packages: 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: Install cosign
uses: sigstore/[email protected]
with:
cosign-release: 'v2.2.4'
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ needs.version.outputs.image_name }}
tags: |
type=raw,value=${{ needs.version.outputs.version }}
type=raw,value=latest
type=sha
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max