|
| 1 | +name: Backend EE Docker Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'backend-ee/v*' |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + packages: write |
| 11 | + |
| 12 | +env: |
| 13 | + REGISTRY: ghcr.io |
| 14 | + IMAGE_NAME: ${{ github.repository }}/digger-backend-ee |
| 15 | + |
| 16 | +jobs: |
| 17 | + build-and-push: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + fetch-depth: 0 |
| 23 | + |
| 24 | + - name: Derive version |
| 25 | + id: meta |
| 26 | + run: | |
| 27 | + TAG="${GITHUB_REF_NAME}" # e.g. backend-ee/v1.2.3 |
| 28 | + VERSION="${TAG##*/}" # v1.2.3 |
| 29 | + echo "version=$VERSION" >> $GITHUB_OUTPUT |
| 30 | +
|
| 31 | + - name: Set up Docker Buildx |
| 32 | + uses: docker/setup-buildx-action@v3 |
| 33 | + |
| 34 | + - name: Log in to Container Registry |
| 35 | + uses: docker/login-action@v3 |
| 36 | + with: |
| 37 | + registry: ${{ env.REGISTRY }} |
| 38 | + username: ${{ github.actor }} |
| 39 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + |
| 41 | + - name: Extract metadata |
| 42 | + id: docker-meta |
| 43 | + uses: docker/metadata-action@v5 |
| 44 | + with: |
| 45 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 46 | + tags: | |
| 47 | + type=raw,value=${{ steps.meta.outputs.version }} |
| 48 | + type=ref,event=tag |
| 49 | + type=raw,value=latest |
| 50 | +
|
| 51 | + - name: Build and push Docker image |
| 52 | + uses: docker/build-push-action@v5 |
| 53 | + with: |
| 54 | + context: . |
| 55 | + file: ./Dockerfile_backend_ee |
| 56 | + push: true |
| 57 | + platforms: linux/amd64,linux/arm64 |
| 58 | + tags: ${{ steps.docker-meta.outputs.tags }} |
| 59 | + labels: ${{ steps.docker-meta.outputs.labels }} |
| 60 | + build-args: | |
| 61 | + COMMIT_SHA=${{ github.sha }} |
| 62 | + VERSION=${{ steps.meta.outputs.version }} |
| 63 | +
|
| 64 | + create-release: |
| 65 | + needs: [build-and-push] |
| 66 | + runs-on: ubuntu-latest |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v4 |
| 69 | + with: |
| 70 | + fetch-depth: 0 |
| 71 | + |
| 72 | + - name: Derive version |
| 73 | + id: meta |
| 74 | + run: | |
| 75 | + TAG="${GITHUB_REF_NAME}" # e.g. backend-ee/v1.2.3 |
| 76 | + VERSION="${TAG##*/}" # v1.2.3 |
| 77 | + echo "version=$VERSION" >> $GITHUB_OUTPUT |
| 78 | +
|
| 79 | + - name: Create GitHub Release |
| 80 | + uses: softprops/action-gh-release@v1 |
| 81 | + with: |
| 82 | + tag_name: ${{ github.ref_name }} |
| 83 | + name: Digger Backend EE ${{ steps.meta.outputs.version }} |
| 84 | + body: | |
| 85 | + ## Digger Backend (Enterprise Edition) ${{ steps.meta.outputs.version }} |
| 86 | + |
| 87 | + Terraform orchestration service with advanced features and multi-VCS support. |
| 88 | + |
| 89 | + ### Docker Image |
| 90 | + ```bash |
| 91 | + docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} |
| 92 | + ``` |
| 93 | + |
| 94 | + draft: false |
| 95 | + prerelease: false |
| 96 | + |
0 commit comments