Release to Docker #6
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: Release to Docker | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Release version tag (e.g. 1.3.1)" | |
required: true | |
type: string | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout This Repository | |
uses: actions/checkout@v4 | |
- name: Download And Extract Release Artifact | |
uses: robinraju/release-downloader@v1 | |
with: | |
token: ${{ secrets.DEPENDENCY_REPO_TOKEN }} | |
repository: Java-Chains/web-chains | |
tag: ${{ inputs.version }} | |
out-file-path: ./ # 下载到当前目录下 | |
fileName: web-chains-${{ inputs.version }}-all.tar.gz | |
extract: true # 解压缩 | |
- name: Show Files | |
run: | | |
pwd | |
ls -lah | |
- 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 Docker hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Build and push image to Docker Hub | |
uses: docker/build-push-action@v6 | |
with: | |
file: Dockerfile | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
javachains/webchains:${{ inputs.version }} | |
javachains/webchains:latest |