Merge pull request #6170 from tsiegleauq/workflow-dispatch
Workflow dispatch
This commit is contained in:
commit
f9296f017b
53
.github/workflows/build_images.yml
vendored
53
.github/workflows/build_images.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: Build Docker images for all OpenSlides services
|
name: Build Docker images for all OpenSlides services
|
||||||
on: push
|
on: [push, workflow_dispatch]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE_VERSION: 4.0.0-dev
|
IMAGE_VERSION: 4.0.0-dev
|
||||||
jobs:
|
jobs:
|
||||||
@ -50,33 +51,33 @@ jobs:
|
|||||||
directory: openslides-permission-service
|
directory: openslides-permission-service
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
- name: Build image
|
- name: Build image
|
||||||
working-directory: ${{ matrix.service.directory }}
|
working-directory: ${{ matrix.service.directory }}
|
||||||
env:
|
env:
|
||||||
DOCKER_BUILDKIT: 1
|
DOCKER_BUILDKIT: 1
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ matrix.service.args }}" != "" ]
|
if [ "${{ matrix.service.args }}" != "" ]
|
||||||
then
|
then
|
||||||
export BUILD_ARGS="--build-arg MODULE=${{ matrix.service.args.MODULE }}
|
export BUILD_ARGS="--build-arg MODULE=${{ matrix.service.args.MODULE }}
|
||||||
--build-arg PORT=${{ matrix.service.args.PORT }}"
|
--build-arg PORT=${{ matrix.service.args.PORT }}"
|
||||||
fi
|
fi
|
||||||
docker build . --tag ${{ matrix.service.name }} $BUILD_ARGS
|
docker build . --tag ${{ matrix.service.name }} $BUILD_ARGS
|
||||||
|
|
||||||
- name: Log into registry
|
- name: Log into registry
|
||||||
run: echo "${{ secrets.GITHUB_TOKEN }}" |
|
run: echo "${{ secrets.GITHUB_TOKEN }}" |
|
||||||
docker login ghcr.io --username ${{ github.actor }} --password-stdin
|
docker login ghcr.io --username ${{ github.actor }} --password-stdin
|
||||||
|
|
||||||
- name: Push image
|
- name: Push image
|
||||||
run: |
|
run: |
|
||||||
IMAGE_ID=ghcr.io/${{ github.repository }}/${{ matrix.service.name }}
|
IMAGE_ID=ghcr.io/${{ github.repository }}/${{ matrix.service.name }}
|
||||||
|
|
||||||
# Change all uppercase to lowercase
|
# Change all uppercase to lowercase
|
||||||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
|
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
|
||||||
|
|
||||||
docker tag ${{ matrix.service.name }} $IMAGE_ID:$IMAGE_VERSION
|
docker tag ${{ matrix.service.name }} $IMAGE_ID:$IMAGE_VERSION
|
||||||
docker push $IMAGE_ID:$IMAGE_VERSION
|
docker push $IMAGE_ID:$IMAGE_VERSION
|
||||||
|
Loading…
Reference in New Issue
Block a user