2022-10-24 22:07:06 +00:00
|
|
|
# Building the Image without pushing to confirm it is still buildable
|
|
|
|
# confirum functionality would unfortunately need way more resources
|
|
|
|
name: build container image
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
- 'development'
|
2022-10-27 23:56:58 +00:00
|
|
|
pull_request:
|
2022-10-24 22:07:06 +00:00
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
- 'development'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-10-27 23:31:14 +00:00
|
|
|
- name: prepare docker-tag
|
|
|
|
env:
|
|
|
|
repository: ${{ github.repository }}
|
|
|
|
run: echo "dockertag=${repository,,}" >> $GITHUB_ENV
|
2022-10-24 22:07:06 +00:00
|
|
|
- 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: Cache Docker layers
|
2022-11-01 00:48:59 +00:00
|
|
|
uses: actions/cache@v3
|
2022-10-24 22:07:06 +00:00
|
|
|
with:
|
|
|
|
path: /tmp/.buildx-cache
|
2022-10-29 16:50:37 +00:00
|
|
|
key: buildx-${{ hashFiles('docker-build/Dockerfile') }}
|
2022-10-28 00:07:27 +00:00
|
|
|
- name: Build container
|
2022-10-24 22:07:06 +00:00
|
|
|
uses: docker/build-push-action@v3
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: docker-build/Dockerfile
|
|
|
|
platforms: linux/amd64
|
|
|
|
push: false
|
2022-10-27 23:31:14 +00:00
|
|
|
tags: ${{ env.dockertag }}:latest
|
2022-10-24 22:07:06 +00:00
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|