Skip to content

Commit

Permalink
feat: GHA Release
Browse files Browse the repository at this point in the history
WIP -> Will edit commit once release is concluded.
  • Loading branch information
kaynetik committed Oct 7, 2024
1 parent 67db291 commit e796a62
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}

0 comments on commit e796a62

Please sign in to comment.