enterprise-update #2292
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/Push dotCMS docker image (on release) | |
on: | |
# push: | |
# branches: | |
# - release-* | |
repository_dispatch: | |
types: | |
- enterprise-update | |
jobs: | |
prepare-build: | |
name: Prepare build | |
runs-on: ubuntu-latest | |
outputs: | |
build_id: ${{ steps.process-params.outputs.build_id }} | |
steps: | |
- run: echo 'GitHub context' | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
- name: Process Params | |
id: process-params | |
run: | | |
if [[ "${{ github.event_name }}" == 'repository_dispatch' ]]; then | |
build_id=${{ github.event.client_payload.build_id }} | |
else | |
build_id=$(basename "${{ github.ref }}") | |
fi | |
if [[ -z "${build_id}" ]]; then | |
echo 'Could not resolve build_id, aborting' | |
exit 1 | |
else | |
echo "Found build_id: ${build_id}" | |
fi | |
echo "build_id=${build_id}" >> $GITHUB_OUTPUT | |
build-push-image: | |
name: Build/Push Image | |
needs: prepare-build | |
uses: ./.github/workflows/maven-build-docker-image.yml | |
with: | |
ref: ${{ needs.prepare-build.outputs.build_id }} | |
docker_platforms: linux/amd64,linux/arm64 | |
force_snapshot: true | |
secrets: | |
docker_io_username: ${{ secrets.DOCKER_USERNAME }} | |
docker_io_token: ${{ secrets.DOCKER_TOKEN }} | |
ghcr_io_username: ${{ secrets.DOCKER_USERNAME }} | |
ghcr_io_token: ${{ secrets.GHCR_TOKEN }} | |
finish-build-push: | |
name: Finish Build/Push | |
needs: build-push-image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Slack Notification | |
if: success() | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.DEVELOPERS_SLACK_WEBHOOK }} | |
SLACK_USERNAME: dotBot | |
SLACK_TITLE: "Attention dotters: Docker image built!" | |
SLACK_MSG_AUTHOR: " " | |
MSG_MINIMAL: true | |
SLACK_FOOTER: "" | |
SLACK_ICON: https://avatars.githubusercontent.com/u/1005263?s=200&v=4 | |
SLACK_MESSAGE: "<!channel> This automated script is happy to announce that a new docker image has been built for *${{ needs.build-push-image.outputs.version }}* with tags: [${{ needs.build-push-image.outputs.tags }}] :docker:" |