fixup! fixup! fixup! fixup! fixup! publish and cd for docker image #3
Workflow file for this run
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: publish | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
- "v*.*.*-*" | |
env: | |
GITHUB_TOKEN: ${{ secrets.WRITE_PACKAGES }} | |
jobs: | |
publish-jars: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: '22' | |
distribution: 'temurin' | |
cache: 'maven' | |
server-id: github | |
settings-path: ${{ github.workspace }} | |
- name: set version from tag | |
run: mvn -B versions:set -DnewVersion=${GITHUB_REF#refs/tags/v} | |
- name: build and deploy | |
run: mvn -B clean deploy --settings settings.xml | |
publish-docker-image: | |
runs-on: self-hosted | |
outputs: | |
should_trigger_deploy: ${{ steps.should_trigger_deploy.outputs.should_trigger_deploy }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.WRITE_PACKAGES }} | |
logout: false | |
- name: set version from tag | |
run: mvn -B versions:set -DnewVersion=${GITHUB_REF#refs/tags/v} -DprocessAllModules | |
- name: build docker image | |
run: docker/build | |
- name: publish docker image | |
run: docker/publish | |
- name: set should_trigger_deploy | |
id: should_trigger_deploy | |
shell: bash | |
run: | | |
pattern='^refs/tags/v[0-9]+\.[0-9]+\.([1-9][0-9]*$|[0-9]+-.*$)' | |
echo "should_trigger_deploy=$([[ "$GITHUB_REF" =~ $pattern ]] && echo true || echo false)" >> $GITHUB_OUTPUT | |
gh-release: | |
needs: [publish-jars, publish-docker-image] | |
runs-on: self-hosted | |
steps: | |
- uses: softprops/action-gh-release@v2 | |
with: | |
token: ${{ secrets.RAW_CI_PAT }} | |
generate_release_notes: true | |
draft: false | |
prerelease: ${{ contains(github.ref_name, '-') }} | |
tag_name: ${{ github.ref_name }} | |
trigger-deploy: | |
needs: publish-docker-image | |
if: needs.publish-docker-image.outputs.should_trigger_deploy == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: tag without 'v' prefix | |
id: extract_tag | |
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
- name: trigger mvp-deployer workflow | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
token: ${{ secrets.RAW_CI_PAT }} | |
repository: raw-labs/mvp-deployer | |
event-type: deploy-patch-das-jira | |
client-payload: |- | |
{ | |
"aws_region": "eu-west-1", | |
"raw_version": "${{ steps.extract_tag.outputs.version }}", | |
"target_env": "integration", | |
"loaded_vars": "integration", | |
"deployer_version": "latest" | |
} |