Bump version (#334) #11
Workflow file for this run
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: 'Releasing Image 🚀' | |
on: | |
push: | |
tags: | |
- 'v*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
release_image: | |
name: 'Releasing Image 🐳' | |
strategy: | |
matrix: | |
config: | |
- { dockerfile: "backend/Dockerfile", platforms: "linux/amd64,linux/arm64" } | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check 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: Login to DockerHub | |
uses: docker/login-action@v3 | |
# if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# # https://github.com/jlumbroso/free-disk-space/tree/54081f138730dfa15788a46383842cd2f914a1be#example | |
# - name: Free Disk Space (Ubuntu) | |
# uses: jlumbroso/free-disk-space@main | |
# with: | |
# # this might remove tools that are actually needed, | |
# # if set to "true" but frees about 6 GB | |
# tool-cache: false | |
# # all of these default to true, but feel free to set to | |
# # "false" if necessary for your workflow | |
# android: true | |
# dotnet: true | |
# haskell: true | |
# large-packages: true | |
# docker-images: true | |
# swap-storage: true | |
- name: Get Tag Name | |
id: tag | |
shell: bash | |
run: | | |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | |
- name: Release Docker image | |
# if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | |
uses: docker/build-push-action@v6 | |
with: | |
context: backend/ | |
push: true | |
platforms: ${{ matrix.config.platforms }} | |
tags: "${{ secrets.DOCKER_REGISTRY_KIRIN }}/${{ secrets.IMAGE_NAME_KIRIN }}:${{ env.TAG }}" | |
file: ${{ matrix.config.dockerfile }} |