Skip to content

Commit 753c9b8

Browse files
committed
Add Deploy to Prod workflow
1 parent 1da75bf commit 753c9b8

File tree

2 files changed

+48
-27
lines changed

2 files changed

+48
-27
lines changed

.github/workflows/prod-deploy.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Deploy to Prod"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version number (e.g., 1.1.0)"
8+
required: true
9+
10+
env:
11+
RELEASE_VERSION: v${{ github.event.inputs.version }}
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Create release
23+
uses: ncipollo/release-action@v1
24+
with:
25+
owner: 2Toad
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
tag: ${{ env.RELEASE_VERSION }}
28+
commit: main
29+
generateReleaseNotes: true
30+
31+
- name: Update major version tag
32+
run: |
33+
git fetch --tags
34+
git config user.name "${{ github.actor }}"
35+
git config user.email "github-actions@github.com"
36+
MAJOR_VERSION=v$(echo ${{ github.event.inputs.version }} | cut -d. -f1)
37+
git tag -fa $MAJOR_VERSION -m "Update $MAJOR_VERSION tag to ${{ env.RELEASE_VERSION }}" ${{ env.RELEASE_VERSION }}
38+
git push origin $MAJOR_VERSION --force

contribute.md

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,13 @@ Thank you for wanting to contribute to this project. With your help we can ensur
1515

1616
## Deployment
1717

18-
### 1. Publish New Release
19-
20-
1. Navigate to [actions's releases](https://github.com/2Toad/actions/releases).
21-
2. Click "Draft a new release":
22-
- **Choose a tag**: enter version (e.g., `v1.1.0`) and click "Create new tag"
23-
- **Target**: `main`
24-
- **Previous tag**: `auto`
25-
- **Release title**: (e.g., `1.1.0`)
26-
- **Description**: click the "Generate release notes"
27-
- [x] **Set as the latest release**
28-
3. Click "Publish release".
29-
30-
2. ### Update Major Version Tag
31-
32-
After publishing a new release, update the major version tag using the following CLI commands:
33-
34-
1. Ensure you're on the main branch and have the latest changes:
35-
```bash
36-
git checkout main
37-
git pull origin main
38-
```
39-
2. Update the major version tag:
40-
```bash
41-
git tag -fa v1 -m "Update v1 tag to latest release" v1.1.0
42-
git push origin v1 --force
43-
```
44-
Replace `v1` with the appropriate major version (e.g., v2) and `v1.1.0` with the newest release (e.g., v2.0.3).
18+
1. Navigate to the [Actions tab](https://github.com/2Toad/actions/actions)
19+
2. Select the "Deploy to Prod" workflow
20+
3. Click "Run workflow".
21+
4. Enter a version number using semantic versioning (e.g., `1.1.0`).
22+
5. Click "Run workflow" to start the process.
23+
24+
This automated workflow will:
25+
- Create a new release with the specified version number
26+
- Generate release notes
27+
- Update the corresponding major version tag (e.g. `v1` will point to v1.x)

0 commit comments

Comments
 (0)