diff --git a/.github/workflows/publish_docker_image.yml b/.github/workflows/publish_docker_image.yml new file mode 100644 index 0000000..a9177ee --- /dev/null +++ b/.github/workflows/publish_docker_image.yml @@ -0,0 +1,35 @@ +name: Publish Docker image + +on: + push: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Get project version + id: get_project_version + run: | + VERSION=$(> $GITHUB_OUTPUT + - if: github.event_name == 'release' || endsWith(steps.get_project_version.outputs.version, '-SNAPSHOT') + name: Login to AERIUS Container Registry + uses: docker/login-action@v1 + with: + registry: nexus-docker.aerius.nl + username: ${{ secrets.nexus_username }} + password: ${{ secrets.nexus_password }} + - if: github.event_name == 'release' || endsWith(steps.get_project_version.outputs.version, '-SNAPSHOT') + name: Build and push images + run: | + export DOCKER_REGISTRY_URL=nexus-docker.aerius.nl + + echo '### Generating Dockerfiles ### ' + ./update.sh + + echo '### Building and pushing images ### ' + PUSH_IMAGES=true ./build_images.sh