Skip to content

dockerbuild

dockerbuild #9

Workflow file for this run

name: dockerbuild
on:
workflow_dispatch:
push:
branches:
- master
paths:
- "**"
- "!.github/**"
- "!**.md"
- "!docker-compose.yml"
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
main:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
- app: frontend
path: frontend
version: 1.3.1
experimental: true
- app: backend
path: backend
version: 1.3.1
experimental: true
- app: app_sdk
path: backend/app_sdk
version: 1.3.1
experimental: true
- app: orborus
path: functions/onprem/orborus
version: 1.3.1
experimental: true
- app: worker
path: functions/onprem/worker
version: 1.3.1
experimental: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: "amd64,arm64,arm"
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Ghcr Build and push
id: docker_build
uses: docker/build-push-action@v4
env:
BUILDX_NO_DEFAULT_LOAD: true
with:
logout: false
context: ${{ matrix.path }}/
file: ${{ matrix.path }}/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: |
ghcr.io/gsoc2/gsoc2-${{ matrix.app }}:${{ matrix.version }}
ghcr.io/gsoc2/gsoc2-${{ matrix.app }}:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}