Staging update 20230725 (#6626) #2
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 Docker images for all OpenSlides services | |
on: | |
push: | |
branches: | |
- main | |
- stable/4* | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Builds Docker images | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
service: | |
- name: proxy | |
- name: client | |
- name: backend | |
- name: datastore-reader | |
- name: datastore-writer | |
- name: autoupdate | |
- name: auth | |
- name: vote | |
- name: icc | |
- name: media | |
- name: manage | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Log into registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | | |
docker login ghcr.io --username ${{ github.actor }} --password-stdin | |
- name: Build and push image | |
run: | | |
DOCKER_REPO=ghcr.io/${{ github.repository }} | |
# Change all uppercase to lowercase | |
DOCKER_REPO=$(echo $DOCKER_REPO | tr '[A-Z]' '[a-z]') | |
# Build and push with tag determined by build.sh | |
./dev/docker/build.sh -D $DOCKER_REPO ${{ matrix.service.name }} | |
docker push $(./dev/docker/build.sh -D $DOCKER_REPO --images ${{ matrix.service.name }}) | |
# Build and push with tag 'latest' (when on stable branch) | |
case "$(git rev-parse --abbrev-ref HEAD)" in stable/4*) | |
./dev/docker/build.sh -D $DOCKER_REPO -t latest ${{ matrix.service.name }} | |
docker push $(./dev/docker/build.sh -D $DOCKER_REPO -t latest --images ${{ matrix.service.name }}) | |
esac |