Add openslides-proxy to labels script (#6712) #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 | |
outputs: | |
openslides-version: ${{ steps.readversion.outputs.version }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
service: | |
- name: proxy | |
- name: client | |
- name: backend | |
- name: datastore-reader | |
- name: datastore-writer | |
- name: autoupdate | |
- name: auth | |
- name: search | |
- name: vote | |
- name: icc | |
- name: media | |
- name: manage | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Read version | |
id: readversion | |
run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT" | |
- 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 | |
dispatch-build-manage-tool: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref_name, 'stable/4') | |
needs: build | |
steps: | |
- name: Generate access token | |
uses: tibdex/github-app-token@v1 | |
id: generate-token | |
with: | |
app_id: ${{ secrets.AUTOMATION_APP_ID }} | |
private_key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }} | |
- name: Send dispatch to openslides-manage | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
event-type: stable-update | |
repository: ${{ github.repository_owner }}/openslides-manage-service | |
token: ${{ steps.generate-token.outputs.token }} | |
client-payload: '{"branch": "${{ github.ref_name }}", "version": "${{ needs.build.outputs.openslides-version }}"}' |