summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2023-12-26 06:20:48 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2023-12-26 06:20:48 +0530
commit1be3ab5a61f4d8f1d06d3b99a864bba71dd2d9cc (patch)
tree95907cdc40bf5083ce81ab73e5ab67b58d4067bf
parent062990151484e7886ad4d82d395d29e00482d839 (diff)
Workflows & README: Adding workflow for docker image and binary releases, Updating TODO Status
-rw-r--r--.github/workflows/go-releaser.yml26
-rw-r--r--.github/workflows/publish-ghcr.yml29
-rw-r--r--README.md2
3 files changed, 56 insertions, 1 deletions
diff --git a/.github/workflows/go-releaser.yml b/.github/workflows/go-releaser.yml
new file mode 100644
index 0000000..6d0ac23
--- /dev/null
+++ b/.github/workflows/go-releaser.yml
@@ -0,0 +1,26 @@
+name: goreleaser
+
+on:
+ push:
+ tags:
+ - "v*"
+
+jobs:
+ goreleaser:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v4
+
+ - name: Set up Go
+ uses: actions/setup-go@v4
+ with:
+ go-version: 1.21
+
+ - name: Run GoReleaser
+ uses: goreleaser/goreleaser-action@v5
+ with:
+ version: latest
+ args: release --clean
+ env:
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
diff --git a/.github/workflows/publish-ghcr.yml b/.github/workflows/publish-ghcr.yml
new file mode 100644
index 0000000..d697929
--- /dev/null
+++ b/.github/workflows/publish-ghcr.yml
@@ -0,0 +1,29 @@
+name: Docker Image CI for GHCR
+
+on:
+ push:
+ tags:
+ - "v*"
+
+jobs:
+ build_and_publish:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v4
+
+ - name: Log in to GHCR
+ uses: docker/login-action@v2
+ with:
+ registry: ghcr.io
+ username: ${{ github.repository_owner }}
+ password: ${{ secrets.GH_TOKEN }}
+
+ - name: Build and push image
+ uses: docker/build-push-action@v5
+ with:
+ context: .
+ push: true
+ tags: |
+ ghcr.io/${{ github.repository_owner }}/go-fis-api:${{ github.ref_name }}
+ ghcr.io/${{ github.repository_owner }}/go-fis-api:latest
diff --git a/README.md b/README.md
index 1d79c38..2643d5b 100644
--- a/README.md
+++ b/README.md
@@ -95,7 +95,7 @@ Once the server is running, you can access the API endpoints to upload a file fo
- [x] Containerize the API
- [x] Optimize Docker Image size (Previously 509MB, Optimized: 22.2MB)
- [x] Exclude [go-sqlite3](https://pkg.go.dev/github.com/mattn/go-sqlite3) as the SQLite3 driver in favor of a CGO-free port written in pure Go - [modernc-sqlite](https://pkg.go.dev/modernc.org/sqlite) (to avoid CGO cross-compilation errors)
-- [ ] Create a Github workflow for binary releases and docker image packages
+- [x] Create a Github workflow for binary releases and docker image packages
## License