Skip to content

Docker Build

Docker Build #147

Workflow file for this run

name: Docker Build
on:
workflow_dispatch:
inputs:
tag:
description: "Docker tag"
required: true
default: "latest"
jobs:
build-containers:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Declare some variables
id: vars
shell: bash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Backend
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}/backend:${{ github.event.inputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
COMMIT=${{ steps.vars.outputs.sha_short }}
APP=backend
START_COMMAND=start
- name: Build Admin
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}/admin:${{ github.event.inputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
COMMIT=${{ steps.vars.outputs.sha_short }}
APP=admin
START_COMMAND=start
- name: Build Server
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}/server:${{ github.event.inputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
COMMIT=${{ steps.vars.outputs.sha_short }}
APP=server
START_COMMAND=start
- name: Build Frontend
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}/frontend:${{ github.event.inputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
COMMIT=${{ steps.vars.outputs.sha_short }}
APP=frontend
START_COMMAND=start