Develop #53
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 Kassiopeia | |
on: | |
pull_request: | |
push: | |
branches: [main, develop] | |
tags: ['*'] | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
BASE_IMG_REPO: project8/luna_base | |
BASE_IMG_TAG: v1.3.3 | |
KASS_REPO: project8/kassiopeia | |
KASS_TAG: v4.0.0 | |
NARG: 2 | |
jobs: | |
docker-build-and-publish: | |
name: Build and push the docker images | |
strategy: | |
matrix: | |
build: [Dev, Prod] | |
fail-fast: [false] | |
include: | |
- build: Dev | |
tag-suffix: '-dev' | |
build-type: Debug | |
build-tests: true | |
- build: Prod | |
tag-suffix: '' | |
build-type: Release | |
build-tests: false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout builder repo | |
uses: actions/checkout@v3 | |
- name: Check out Kassiopeia | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ env.KASS_REPO }} | |
ref: ${{ env.KASS_TAG }} | |
submodules: recursive | |
fetch-depth: 0 | |
path: kassiopeia | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ github.repository }} | |
flavor: | | |
latest=auto | |
suffix=${{ matrix.tag-suffix }},onlatest=true | |
tags: | | |
type=raw,value=${{ env.KASS_TAG }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
id: setup_buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
buildkitd-flags: --debug | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Kassiopeia | |
id: build-kass | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: Dockerfile | |
#push: true | |
push: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} | |
load: false | |
build-args: | | |
build_img_repo=${{ env.REGISTRY }}/${{ env.BASE_IMG_REPO }} | |
build_img_tag=${{ env.BASE_IMG_TAG }}-dev | |
final_img_repo=${{ env.REGISTRY }}/${{ env.BASE_IMG_REPO }} | |
final_img_tag=${{ env.BASE_IMG_TAG }}${{ matrix.tag-suffix }} | |
kass_tag=${{ env.KASS_TAG }} | |
build_type=${{ matrix.build-type }} | |
narg=${{ env.NARG }} | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
platforms: linux/amd64 | |
# For debugging | |
- name: Setup tmate session | |
if: ${{ ! success() }} | |
uses: mxschmitt/action-tmate@v3 | |