Skip to content

release-3.0.3.1-kntu.5 #9

release-3.0.3.1-kntu.5

release-3.0.3.1-kntu.5 #9

env:
RUBY_VERSION: 3.1
name: CI Build Release
on:
release:
types: [released]
jobs:
main:
name: Build Docker Image
env:
DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }}
DOCKER_BUILD_ENABLED: ${{ secrets.DOCKER_BUILD_ENABLED }}
runs-on: ubuntu-20.04
steps:
- name: Checkout
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
uses: actions/checkout@v2
- name: Set up Docker Buildx
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract Docker Repository
id: ci_docker_repository
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
shell: bash
run: echo "##[set-output name=repository;]$(echo $DOCKER_REPOSITORY/${GITHUB_REPOSITORY#*/})"
- name: Extract Tag Release Version
id: ci_tag_release_version
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
shell: bash
run: echo "##[set-output name=tag;]$(echo ${{github.ref_name}} | cut -c 9-)"
- name: Build and Push
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
uses: docker/build-push-action@v3
with:
push: true
tags: |
"${{ steps.ci_docker_repository.outputs.repository }}:v${{ steps.ci_tag_release_version.outputs.tag }}"
"${{ steps.ci_docker_repository.outputs.repository }}:latest"
build-args: "VERSION_TAG=release-${{ steps.ci_tag_release_version.outputs.tag }}"
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache