diff --git a/.github/workflows/cd-prod.yml b/.github/workflows/cd-publish-image.yml similarity index 68% rename from .github/workflows/cd-prod.yml rename to .github/workflows/cd-publish-image.yml index f318f42..05b6e77 100644 --- a/.github/workflows/cd-prod.yml +++ b/.github/workflows/cd-publish-image.yml @@ -1,25 +1,13 @@ -name: Build & Deploy to PROD +name: Publish Docker Image on: release: types: [published] branches: [main] - workflow_call: - inputs: - tag_name: - description: Docker image tag / Release tag - required: true - type: string - target_commitish: - description: Branch to build from - required: true - type: string - jobs: deploy: - if: ${{ inputs.target_commitish == 'main' || github.event.release.target_commitish == 'main' }} - name: Build & Deploy + name: Build & Push Docker Image runs-on: ubuntu-latest permissions: @@ -27,7 +15,7 @@ jobs: packages: write env: - RELEASE_TAG: ${{ inputs.tag_name || github.event.release.tag_name }} + RELEASE_TAG: ${{ github.event.release.tag_name }} steps: - name: Checkout code @@ -49,7 +37,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Generate Docker metadata + - name: Generate Docker Metadata id: meta uses: docker/metadata-action@v5 with: @@ -57,7 +45,7 @@ jobs: tags: | type=semver,pattern={{version}},value=${{ env.RELEASE_TAG }} - - name: Build & Push Docker image + - name: Build & Push Docker Image uses: docker/build-push-action@v5 with: context: . diff --git a/.github/workflows/dispatch-release.yml b/.github/workflows/dispatch-release.yml deleted file mode 100644 index 392c506..0000000 --- a/.github/workflows/dispatch-release.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Dispatch Release & Deploy to PROD -on: - repository_dispatch: - types: - - release-bootstrap-service - -jobs: - create-release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Client payload - run: | - cat <<'EOF' - ${{ toJson(github.event.client_payload) }} - EOF - - - name: Release - if: ${{ github.event.client_payload.release_target_commitish == 'main' }} - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{ github.event.client_payload.release_tag }} - generate_release_notes: true - target_commitish: 'main' - - deploy-prod: - uses: ./.github/workflows/cd-prod.yml - needs: [create-release] - with: - tag_name: ${{ github.event.client_payload.release_tag }} - target_commitish: ${{ github.event.client_payload.release_target_commitish }}