|
| 1 | +name: Docker-Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + releaseVersion: |
| 7 | + description: "Default version to use when preparing a release." |
| 8 | + required: true |
| 9 | + default: "X.Y.Z" |
| 10 | + developmentVersion: |
| 11 | + description: "Default version to use for new local working copy." |
| 12 | + required: true |
| 13 | + default: "X.Y.Z-SNAPSHOT" |
| 14 | +jobs: |
| 15 | + release-docker: |
| 16 | + runs-on: 'ubuntu-latest' |
| 17 | + needs: |
| 18 | + - release-maven |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + ref: ${{ github.event.inputs.releaseVersion }} |
| 23 | + fetch-depth: 1 |
| 24 | + submodules: recursive |
| 25 | + - name: Docker meta |
| 26 | + id: meta |
| 27 | + uses: docker/metadata-action@v5 |
| 28 | + with: |
| 29 | + images: | |
| 30 | + ${{ github.repository }} |
| 31 | + ghcr.io/${{ github.repository }}/${{ github.event.repository.name }} |
| 32 | + tags: | |
| 33 | + type=raw,value=latest |
| 34 | + type=raw,value=${{ github.event.inputs.releaseVersion }} |
| 35 | + - name: Set up QEMU |
| 36 | + uses: docker/setup-qemu-action@v3 |
| 37 | + - name: Set up Docker Buildx |
| 38 | + uses: docker/setup-buildx-action@v3 |
| 39 | + - name: Login to DockerHub |
| 40 | + uses: docker/login-action@v3 |
| 41 | + with: |
| 42 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 43 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 44 | + - name: Login to GHCR |
| 45 | + uses: docker/login-action@v3 |
| 46 | + with: |
| 47 | + registry: ghcr.io |
| 48 | + username: ${{ github.repository_owner }} |
| 49 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + - name: Build and push image |
| 51 | + uses: docker/build-push-action@v5 |
| 52 | + continue-on-error: true |
| 53 | + with: |
| 54 | + context: ./openam-distribution/openam-distribution-docker |
| 55 | + file: ./openam-distribution/openam-distribution-docker/Dockerfile |
| 56 | + build-args: | |
| 57 | + VERSION=${{ github.event.inputs.releaseVersion }} |
| 58 | + platforms: linux/amd64, linux/arm64, linux/ppc64le, linux/s390x |
| 59 | + push: true |
| 60 | + tags: ${{ steps.meta.outputs.tags }} |
| 61 | + labels: ${{ steps.meta.outputs.labels }} |
0 commit comments