Skip to content

Commit b77ae04

Browse files
chore(cicd): set up release workflow
1 parent 522fb2e commit b77ae04

File tree

6 files changed

+2710
-156
lines changed

6 files changed

+2710
-156
lines changed

.github/workflows/deploy-vm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Image, push to Registry and Deploy to Digital Ocean's production environment
1+
name: Build image, push to registry and deploy to Digital Ocean's production environment
22

33
on:
44
push:

.github/workflows/docker-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker
1+
name: Publish Docker image to GitHub Packages
22

33
on:
44
push:
@@ -45,7 +45,7 @@ jobs:
4545
if: github.event_name == 'push'
4646

4747
steps:
48-
- uses: actions/checkout@v2
48+
- uses: actions/checkout@v4
4949

5050
- name: Build image
5151
run: docker build . --file Dockerfile --tag $IMAGE_NAME

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release workflow
2+
3+
permissions:
4+
contents: write # to be able to publish a GitHub release
5+
issues: write # to be able to comment on released issues
6+
pull-requests: write # to be able to comment on released pull requests
7+
id-token: write # to enable use of OIDC for npm provenance
8+
9+
on:
10+
push:
11+
branches:
12+
- main
13+
14+
jobs:
15+
release:
16+
name: release
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: pnpm/action-setup@v4
21+
with:
22+
version: 8
23+
- name: Setup Node.js environment
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 20
27+
cache: "pnpm"
28+
registry-url: "https://registry.npmjs.org"
29+
- run: pnpm install
30+
- run: pnpm run release
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.releaserc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"plugins": [
6+
"@semantic-release/commit-analyzer",
7+
"@semantic-release/release-notes-generator",
8+
"@semantic-release/changelog",
9+
"@semantic-release/npm",
10+
"@semantic-release/git",
11+
"@semantic-release/github"
12+
]
13+
}

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"dev:backend:db": "concurrently -n db,backend \"pnpm run dev:db:up\" \"wait-on tcp:5432 && pnpm run dev:backend\"",
1414
"dev:frontend": "cd frontend && pnpm i && pnpm run dev",
1515
"dev": "concurrently -n backend,frontend \"pnpm run dev:backend\" \"pnpm run dev:frontend\"",
16-
"dev:full": "concurrently -n db,backend,frontend \"pnpm run dev:db:up\" \"wait-on tcp:5432 && pnpm run dev:backend\" \"pnpm run dev:frontend\""
16+
"dev:full": "concurrently -n db,backend,frontend \"pnpm run dev:db:up\" \"wait-on tcp:5432 && pnpm run dev:backend\" \"pnpm run dev:frontend\"",
17+
"release": "semantic-release"
1718
},
1819
"repository": {
1920
"type": "git",
@@ -26,7 +27,10 @@
2627
},
2728
"homepage": "https://github.com/marcelovicentegc/django-react-typescript#readme",
2829
"devDependencies": {
30+
"@semantic-release/changelog": "^6.0.3",
31+
"@semantic-release/git": "^10.0.1",
2932
"concurrently": "^8.2.2",
33+
"semantic-release": "^24.0.0",
3034
"wait-on": "^7.2.0"
3135
}
3236
}

0 commit comments

Comments
 (0)