OpenSlides/.github/workflows/build_images.yml

83 lines
2.3 KiB
YAML
Raw Normal View History

---
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
2021-06-30 16:03:10 +02:00
- name: openslides-icc
directory: openslides-icc-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
run: |
2021-04-30 11:19:21 +02:00
if [ "${{ matrix.service.args }}" != "" ]
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
- name: Push image
run: |
2021-04-30 11:19:21 +02:00
IMAGE_ID=ghcr.io/${{ github.repository }}/${{ matrix.service.name }}
# 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