Build CLI images #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build CLI images | |
env: | |
GITHUB_OUTPUT: "" | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Corresponds to git tag, e.g. "vX.Y.Z"' | |
required: true | |
jobs: | |
psinode-cli-builder: | |
name: psinode-cli-builder | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: false | |
fetch-depth: 0 | |
- name: Preparation | |
id: prep | |
run: | | |
REGISTRY="ghcr.io" | |
IMAGE="${REGISTRY}/${{ github.repository_owner }}/psinode" | |
TAGS="${IMAGE}:${{ github.event.inputs.version }}" | |
echo "tags=${TAGS,,}" >> $GITHUB_OUTPUT | |
- name: Building ${{ steps.prep.outputs.tags }} | |
run: true | |
- name: Docker Buildx setup | |
uses: docker/setup-buildx-action@v3 | |
with: | |
buildkitd-flags: --debug | |
- name: Login in to registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set TOOL_CONFIG version | |
id: tool_cfg_img | |
run: | | |
latest_tag=$(./.github/scripts/latest-tag.sh "gofractally/http-tool-config") | |
echo "TOOL_CONFIG_IMAGE=ghcr.io/gofractally/http-tool-config:${latest_tag}" >> $GITHUB_OUTPUT | |
- name: Build & Publish Image | |
uses: docker/build-push-action@v5 | |
with: | |
build-args: | | |
RELEASE_TAG=${{ github.event.inputs.version }} | |
TOOL_CONFIG_IMAGE=${{ steps.tool_cfg_img.outputs.TOOL_CONFIG_IMAGE }} | |
context: . | |
push: true | |
no-cache: true | |
pull: true | |
file: docker/psinode.Dockerfile | |
tags: ${{ steps.prep.outputs.tags }} | |
psibase-cli-builder: | |
name: psibase-cli-builder | |
runs-on: ubuntu-latest | |
needs: psinode-cli-builder | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: false | |
fetch-depth: 0 | |
- name: Preparation | |
id: prep | |
run: | | |
REGISTRY="ghcr.io" | |
IMAGE="${REGISTRY}/${{ github.repository_owner }}/psibase" | |
TAGS="${IMAGE}:${{ github.event.inputs.version }}" | |
echo "tags=${TAGS,,}" >> $GITHUB_OUTPUT | |
- name: Showtag | |
id: showtag | |
run: echo ${{ steps.prep.outputs.tags }} | |
- name: Docker Buildx setup | |
uses: docker/setup-buildx-action@v3 | |
with: | |
buildkitd-flags: --debug | |
- name: Login in to registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build & Publish Image | |
uses: docker/build-push-action@v5 | |
with: | |
build-args: | | |
psinode_version=${{ github.event.inputs.version }} | |
context: . | |
push: true | |
no-cache: true | |
pull: true | |
file: docker/psibase.Dockerfile | |
tags: ${{ steps.prep.outputs.tags }} |