Docker Publish #8
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: Docker Publish | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
inputs: | |
isLatest: | |
description: "Add latest tag" | |
default: "true" | |
required: true | |
jobs: | |
publish-docker: | |
name: publish-docker | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # Needed for auth with Deno Deploy | |
contents: read # Needed to clone the repository | |
steps: | |
- 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: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: subquerynetwork | |
password: ${{ secrets.SQ_DOCKERHUB_TOKEN }} | |
# Read the version from deno.json | |
- name: Extract version | |
id: extract_version | |
run: | | |
version=$(cat deno.json | jq -r '.version') | |
echo "AI_APP_VERSION=$version" >> $GITHUB_ENV | |
- name: Build and push | |
if: github.event_name == 'workflow_dispatch' && github.event.inputs.isLatest == 'false' | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
platforms: arm64,amd64 | |
file: ./Dockerfile | |
tags: subquerynetwork/subql-ai-app:v${{ env.AI_APP_VERSION }} | |
build-args: RELEASE_VERSION=${{ env.AI_APP_VERSION }} | |
- name: Build and push | |
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.isLatest == 'true') | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
platforms: arm64,amd64 | |
file: ./Dockerfile | |
tags: subquerynetwork/subql-ai-app:v${{ env.AI_APP_VERSION }},subquerynetwork/subql-ai-app:latest | |
build-args: RELEASE_VERSION=${{ env.AI_APP_VERSION }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |