Skip to content

v0.71.3

v0.71.3 #392

name: Build App component image
on:
release:
types: [ published ]
workflow_dispatch:
inputs:
tag:
description: Image tag
required: true
jobs:
build:
runs-on: ubuntu-latest
# see https://github.com/docker/build-push-action
steps:
# Setup (see https://github.com/docker/build-push-action)
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Publish to Docker hub
- name: Store version number (on release)
if: ${{ github.event_name == 'release' }}
id: version
# GITHUB_REF looks like "refs/tags/0.3.1" - we need to extract the actual version without the v prefix
run: echo "number=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
# Caches
- name: Cache var-cache-apt
id: cache-var-cache-apt
uses: actions/cache@v3
with:
path: var-cache-apt
key: var-cache-apt-${{ hashFiles('Dockerfile') }}
- name: Cache var-lib-apt
id: cache-var-lib-apt
uses: actions/cache@v3
with:
path: var-lib-apt
key: var-lib-apt-${{ hashFiles('Dockerfile') }}
- name: Cache root-.cache
id: cache-root-cache
uses: actions/cache@v3
with:
path: root-.cache
key: root-.cache-${{ hashFiles('Dockerfile') }}
- name: inject var-cache-apt into docker
uses: reproducible-containers/[email protected]
with:
cache-source: var-cache-apt
cache-target: /var/cache/apt
skip-extraction: ${{ steps.cache-var-cache-apt.outputs.cache-hit }}
- name: inject var-lib-apt into docker
uses: reproducible-containers/[email protected]
with:
cache-source: var-lib-apt
cache-target: /var/lib/apt
skip-extraction: ${{ steps.cache-var-lib-apt.outputs.cache-hit }}
- name: inject root-.cache into docker
uses: reproducible-containers/[email protected]
with:
cache-source: root-.cache
cache-target: /root/.cache
skip-extraction: ${{ steps.cache-root-cache.outputs.cache-hit }}
# Release push (with a tag)
- name: Build and push (on release)
if: ${{ github.event_name == 'release' }}
uses: docker/build-push-action@v4
with:
push: true
context: .
target: app
file: Dockerfile
cache-from: type=registry,ref=blsq/openhexa-app:buildcache
cache-to: type=registry,ref=blsq/openhexa-app:buildcache,mode=max
tags: |
blsq/openhexa-app:${{ steps.version.outputs.number }}
blsq/openhexa-app:latest
# Manual push
- name: Build and push (manual)
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: docker/build-push-action@v4
with:
push: true
context: .
target: app
file: Dockerfile
cache-from: type=registry,ref=blsq/openhexa-app:buildcache
cache-to: type=registry,ref=blsq/openhexa-app:buildcache,mode=max
tags: |
blsq/openhexa-app:${{ github.event.inputs.tag }}
blsq/openhexa-app:latest