|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + pull-requests: write |
| 11 | + |
| 12 | +jobs: |
| 13 | + release: |
| 14 | + name: Release |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v4 |
| 19 | + with: |
| 20 | + fetch-depth: 0 |
| 21 | + |
| 22 | + - name: Setup Go |
| 23 | + uses: actions/setup-go@v4 |
| 24 | + with: |
| 25 | + go-version: "1.25" |
| 26 | + |
| 27 | + - name: Release |
| 28 | + id: semantic-release |
| 29 | + uses: googleapis/release-please-action@v4 |
| 30 | + with: |
| 31 | + release-type: simple |
| 32 | + token: ${{ secrets.GH_TOKEN }} |
| 33 | + |
| 34 | + - name: Tag Images |
| 35 | + if: ${{ steps.semantic-release.outputs.release_created }} |
| 36 | + run: | |
| 37 | + VERSION=${{ steps.semantic-release.outputs.tag_name }} |
| 38 | + env: |
| 39 | + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |
| 40 | + |
| 41 | + build-app: |
| 42 | + name: Build API App |
| 43 | + |
| 44 | + needs: release |
| 45 | + if: ${{ needs.release.outputs.release_created }} |
| 46 | + |
| 47 | + uses: ./.github/workflows/build-image.yaml |
| 48 | + secrets: inherit |
| 49 | + |
| 50 | + with: |
| 51 | + image-name: ctrlplane/api |
| 52 | + dockerfile: apps/api/Dockerfile |
| 53 | + platform: "linux/amd64" |
| 54 | + tags: | |
| 55 | + type=semver,pattern={{version}},value=${{ needs.release.outputs.tag_name }} |
| 56 | + type=semver,pattern={{major}}.{{minor}},value=${{ needs.release.outputs.tag_name }} |
| 57 | + type=semver,pattern={{major}},value=${{ needs.release.outputs.tag_name }} |
| 58 | + type=raw,value=latest |
| 59 | +
|
| 60 | + build-web: |
| 61 | + name: Build Web App |
| 62 | + |
| 63 | + needs: release |
| 64 | + if: ${{ needs.release.outputs.release_created }} |
| 65 | + |
| 66 | + uses: ./.github/workflows/build-image.yaml |
| 67 | + secrets: inherit |
| 68 | + |
| 69 | + with: |
| 70 | + image-name: ctrlplane/web |
| 71 | + dockerfile: apps/web/Dockerfile |
| 72 | + platform: "linux/amd64" |
| 73 | + tags: | |
| 74 | + type=semver,pattern={{version}},value=${{ needs.release.outputs.tag_name }} |
| 75 | + type=semver,pattern={{major}}.{{minor}},value=${{ needs.release.outputs.tag_name }} |
| 76 | + type=semver,pattern={{major}},value=${{ needs.release.outputs.tag_name }} |
| 77 | + type=raw,value=latest |
| 78 | +
|
| 79 | + build-workspace-engine: |
| 80 | + name: Build Workspace Engine |
| 81 | + |
| 82 | + needs: release |
| 83 | + if: ${{ needs.release.outputs.release_created }} |
| 84 | + |
| 85 | + uses: ./.github/workflows/build-image.yaml |
| 86 | + secrets: inherit |
| 87 | + |
| 88 | + with: |
| 89 | + image-name: ctrlplane/workspace-engine |
| 90 | + dockerfile: apps/workspace-engine/Dockerfile |
| 91 | + platform: "linux/amd64" |
| 92 | + tags: | |
| 93 | + type=semver,pattern={{version}},value=${{ needs.release.outputs.tag_name }} |
| 94 | + type=semver,pattern={{major}}.{{minor}},value=${{ needs.release.outputs.tag_name }} |
| 95 | + type=semver,pattern={{major}},value=${{ needs.release.outputs.tag_name }} |
| 96 | + type=raw,value=latest |
0 commit comments