2021-04-24 10:20:12 +02:00
|
|
|
---
|
|
|
|
name: Build Docker images for all OpenSlides services
|
|
|
|
on: push
|
|
|
|
env:
|
|
|
|
IMAGE_VERSION: 4.0.0-dev
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Builds Docker images
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
service:
|
|
|
|
- name: openslides-proxy
|
|
|
|
directory: proxy
|
|
|
|
|
|
|
|
- name: openslides-client
|
|
|
|
directory: openslides-client
|
|
|
|
|
|
|
|
- name: openslides-backend
|
|
|
|
directory: openslides-backend
|
|
|
|
|
|
|
|
- name: openslides-datastore-reader
|
|
|
|
directory: openslides-datastore-service
|
|
|
|
args:
|
|
|
|
MODULE: reader
|
|
|
|
PORT: 9010
|
|
|
|
|
|
|
|
- name: openslides-datastore-writer
|
|
|
|
directory: openslides-datastore-service
|
|
|
|
args:
|
|
|
|
MODULE: writer
|
|
|
|
PORT: 9011
|
|
|
|
|
|
|
|
- name: openslides-autoupdate
|
|
|
|
directory: openslides-autoupdate-service
|
|
|
|
|
|
|
|
- name: openslides-auth
|
|
|
|
directory: openslides-auth-service
|
|
|
|
|
|
|
|
- name: openslides-media
|
|
|
|
directory: openslides-media-service
|
|
|
|
|
|
|
|
- name: openslides-manage
|
|
|
|
directory: openslides-manage-service
|
|
|
|
|
|
|
|
- name: openslides-permission
|
|
|
|
directory: openslides-permission-service
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
|
|
|
|
- name: Build image
|
|
|
|
working-directory: ${{ matrix.service.directory }}
|
|
|
|
env:
|
2021-04-30 11:19:21 +02:00
|
|
|
DOCKER_BUILDKIT: 1
|
2021-04-24 10:20:12 +02:00
|
|
|
run: |
|
2021-04-30 11:19:21 +02:00
|
|
|
if [ "${{ matrix.service.args }}" != "" ]
|
2021-04-24 10:20:12 +02:00
|
|
|
then
|
|
|
|
export BUILD_ARGS="--build-arg MODULE=${{ matrix.service.args.MODULE }}
|
|
|
|
--build-arg PORT=${{ matrix.service.args.PORT }}"
|
|
|
|
fi
|
|
|
|
docker build . --tag ${{ matrix.service.name }} $BUILD_ARGS
|
|
|
|
|
|
|
|
- name: Log into registry
|
|
|
|
run: echo "${{ secrets.GITHUB_TOKEN }}" |
|
2021-04-30 11:19:21 +02:00
|
|
|
docker login ghcr.io --username ${{ github.actor }} --password-stdin
|
2021-04-24 10:20:12 +02:00
|
|
|
|
|
|
|
- name: Push image
|
|
|
|
run: |
|
2021-04-30 11:19:21 +02:00
|
|
|
IMAGE_ID=ghcr.io/${{ github.repository }}/${{ matrix.service.name }}
|
2021-04-24 10:20:12 +02:00
|
|
|
|
|
|
|
# Change all uppercase to lowercase
|
|
|
|
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
|
|
|
|
|
|
|
|
docker tag ${{ matrix.service.name }} $IMAGE_ID:$IMAGE_VERSION
|
|
|
|
docker push $IMAGE_ID:$IMAGE_VERSION
|