Some checks failed
- Migrate to forgejo - Bump Rust & Node - Reformat project - Small script cleanup Reviewed-on: https://home.schmelczer.dev/git/git/andras/vault-link/pulls/189 Co-authored-by: Andras Schmelczer <andras@schmelczer.dev> Co-committed-by: Andras Schmelczer <andras@schmelczer.dev>
51 lines
1.5 KiB
YAML
51 lines
1.5 KiB
YAML
name: Publish CLI
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
tags: ["*"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
|
|
jobs:
|
|
publish-docker:
|
|
runs-on: ubuntu-docker
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Extract registry hostname
|
|
id: registry
|
|
run: echo "host=$(echo '${{ github.server_url }}' | sed 's|https\?://||')" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log into container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ steps.registry.outputs.host }}
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ steps.registry.outputs.host }}/${{ github.repository }}-cli
|
|
|
|
- name: Build and push Docker image
|
|
id: build-and-push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: frontend
|
|
file: frontend/local-client-cli/Dockerfile
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=registry,ref=${{ steps.registry.outputs.host }}/${{ github.repository }}-cli:buildcache
|
|
cache-to: type=registry,ref=${{ steps.registry.outputs.host }}/${{ github.repository }}-cli:buildcache,mode=max
|