diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c5fbe6c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,73 @@ +name: 🚀 Release + +on: + push: + # tags: ["*"] + +permissions: + contents: write + packages: write + +env: + REGISTRY_IMAGE: ghcr.io/${{ github.repository }}/seda-data-proxy + +jobs: + build-and-push: + name: 🐳 Build and Push Docker Image + runs-on: ubuntu-latest + steps: + - name: 📥 Checkout code + uses: actions/checkout@v4 + + - name: 🏷️ Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY_IMAGE }} + + - name: 🛠️ Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: 🔐 Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: 🏗️ Build and Push Docker Image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + ${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }} + ${{ env.REGISTRY_IMAGE }}:latest + labels: ${{ steps.meta.outputs.labels }} + + create-release: + name: 📦 Create GitHub Release + needs: build-and-push + runs-on: ubuntu-latest + steps: + - name: 📥 Checkout code + uses: actions/checkout@v4 + + - name: 📝 Generate Changelog + id: changelog + uses: TriPSs/conventional-changelog-action@v5.3.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + output-file: false + skip-commit: true + skip-tag: true + skip-git-pull: true + git-push: false + + - name: 🎉 Create GitHub Release + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + generateReleaseNotes: true + body: ${{ steps.changelog.outputs.changelog }} + token: ${{ secrets.GITHUB_TOKEN }}