Skip to content

Commit

Permalink
setup semantic-release (#5)
Browse files Browse the repository at this point in the history
* test semantic release

* test

* test

* fix: test

* fix: test

* fix: test

* fix: test
  • Loading branch information
m-adawi authored Jul 15, 2024
1 parent 6d522cb commit 486255b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/docker-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Build and push docker image
on:
push:
paths:
- "**.go"
- "go.mod"
- "go.sum"
- "Dockerfile"
# - "**.go"
# - "go.mod"
# - "go.sum"
# - "Dockerfile"
branches:
- main
- gin-server
Expand All @@ -22,19 +22,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3

- name: Build docker image
uses: docker/build-push-action@v6
with:
node-version: "lts/*"
load: true

- name: Release
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Docker registry
uses: docker/login-action@v3
Expand All @@ -43,8 +44,9 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
- name: Push docker image
uses: docker/build-push-action@v6
if: ${{ steps.release.outputs.new_release_published == 'true' }}
with:
push: true
tags: ghcr.io/${{ github.repository }}:latest
tags: ghcr.io/${{ github.repository }}:latest, ghcr.io/${{ github.repository }}:${{ steps.release.outputs.new_release_version }}
7 changes: 6 additions & 1 deletion .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
branches:
- main
- main
- gin-server
plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
- "@semantic-release/github"
2 changes: 1 addition & 1 deletion web.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ func init(){
func runWebServer() {
err := router.Run("localhost:8080")
handleInitError(err)
}
}

0 comments on commit 486255b

Please sign in to comment.