Build Docker Image #38
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 Docker Image | |
env: | |
DOCKERHUB_REPO: jimmymasaru/focalboard | |
on: | |
workflow_dispatch: | |
inputs: | |
release_tag: | |
description: "Focalboard tag" | |
required: true | |
default: "v7.1.0" | |
jobs: | |
Build-Docker-Image: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "Triggered by event ${{ github.event_name }}. Running in ${{ runner.os }}." | |
- id: get-release-tag | |
uses: actions/github-script@v5 | |
with: | |
result-encoding: string | |
script: | | |
const release_tag = context.payload.inputs.release_tag; | |
return release_tag.substring('v'.length); | |
- run: echo "Repository tag ${{ github.event.inputs.release_tag }}; Release tag ${{ steps.get-release-tag.outputs.result }}." | |
- name: Check out | |
uses: actions/checkout@master | |
- name: Update Docker Hub readme file | |
uses: peter-evans/dockerhub-description@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
repository: ${{ env.DOCKERHUB_REPO }} | |
# https://github.com/marketplace/actions/build-and-push-docker-images#git-context | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push stable release | |
if: ${{ !contains(github.event.inputs.release_tag, '-rc') }} | |
uses: docker/build-push-action@v2 | |
with: | |
platforms: linux/arm/v7 | |
push: true | |
build-args: | | |
FOCALBOARD_TAG=${{ github.event.inputs.release_tag }} | |
FOCALBOARD_DOCKER_TAG=${{ steps.get-release-tag.outputs.result }} | |
tags: | | |
${{ env.DOCKERHUB_REPO }}:latest | |
${{ env.DOCKERHUB_REPO }}:${{ steps.get-release-tag.outputs.result }} | |
- name: Build and push non-stable release | |
if: ${{ contains(github.event.inputs.release_tag, '-rc') }} | |
uses: docker/build-push-action@v2 | |
with: | |
platforms: linux/arm/v7 | |
push: true | |
build-args: | | |
FOCALBOARD_TAG=${{ github.event.inputs.release_tag }} | |
FOCALBOARD_DOCKER_TAG=${{ steps.get-release-tag.outputs.result }} | |
tags: | | |
${{ env.DOCKERHUB_REPO }}:${{ steps.get-release-tag.outputs.result }} |