Skip to content

Commit e43b074

Browse files
authored
chore: enhanced workflows (kamranahmedse#6977)
* Enhanced Workflows. * Changed the PR Reviewer to the Final Boss.
1 parent 3f0301c commit e43b074

5 files changed

Lines changed: 96 additions & 71 deletions

File tree

.github/workflows/deployment.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,41 @@
11
name: Deploy to EC2
2+
23
on:
3-
workflow_dispatch: # allow manual run
4+
workflow_dispatch:
5+
46
jobs:
57
deploy:
68
runs-on: ubuntu-latest
79
steps:
8-
- name: Checkout code
9-
uses: actions/checkout@v2
10+
- name: Checkout Repository
11+
uses: actions/checkout@v4
1012
with:
1113
fetch-depth: 2
12-
- uses: actions/setup-node@v1
14+
- uses: actions/setup-node@v4
1315
with:
1416
node-version: 20
15-
- uses: pnpm/action-setup@v3.0.0
17+
- uses: pnpm/action-setup@v4.0.0
1618
with:
17-
version: 8.15.6
19+
version: 9
1820

19-
# --------------------
21+
# -------------------
2022
# Setup configuration
21-
# --------------------
23+
# -------------------
2224
- name: Prepare configuration files
2325
run: |
2426
git clone https://${{ secrets.GH_PAT }}@github.com/roadmapsh/infra-config.git configuration --depth 1
2527
- name: Copy configuration files
2628
run: |
2729
cp configuration/dist/github/developer-roadmap.env .env
2830
29-
# --------------------
30-
# Prepare the build
31-
# --------------------
32-
- name: Install dependencies
31+
# -----------------
32+
# Prepare the Build
33+
# -----------------
34+
- name: Install Dependencies
3335
run: |
3436
pnpm install
35-
- name: Generate build
37+
38+
- name: Generate Production Build
3639
run: |
3740
git clone https://${{ secrets.GH_PAT }}@github.com/roadmapsh/web-draw.git .temp/web-draw --depth 1
3841
npm run generate-renderer
@@ -45,7 +48,7 @@ jobs:
4548
- uses: webfactory/[email protected]
4649
with:
4750
ssh-private-key: ${{ secrets.EC2_PRIVATE_KEY }}
48-
- name: Deploy app to EC2
51+
- name: Deploy Application to EC2
4952
run: |
5053
rsync -apvz --delete --no-times --exclude "configuration" -e "ssh -o StrictHostKeyChecking=no" -p ./ ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }}:/var/www/roadmap.sh/
5154
- name: Restart PM2
@@ -58,9 +61,9 @@ jobs:
5861
cd /var/www/roadmap.sh
5962
sudo pm2 restart web-roadmap
6063
61-
# --------------------
64+
# ----------------------
6265
# Clear cloudfront cache
63-
# --------------------
66+
# ----------------------
6467
- name: Clear Cloudfront Caching
6568
run: |
6669
curl -L \

.github/workflows/label-issue.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
name: Label Issue
2+
23
on:
34
issues:
45
types: [ opened, edited ]
6+
57
jobs:
68
label-topic-change-issue:
79
runs-on: ubuntu-latest
810
steps:
9-
- name: Add roadmap slug to issue as label
10-
uses: actions/github-script@v3
11+
- name: Add Labels To Issue
12+
uses: actions/github-script@v7
1113
with:
1214
github-token: ${{ secrets.GITHUB_TOKEN }}
1315
script: |
Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,52 @@
1-
name: Refreshes roadmap content JSON
1+
name: Refresh Roadmap Content JSON
22

33
on:
4-
workflow_dispatch: # allow manual run
4+
workflow_dispatch:
55
schedule:
6-
- cron: '0 0 * * *' # every day at midnight
6+
- cron: '0 0 * * *'
77

88
jobs:
9-
upgrade-deps:
9+
refresh-content:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v4
12+
- uses: actions/checkout@v4
1413

15-
- name: Setup pnpm
14+
- name: Setup pnpm@v9
1615
uses: pnpm/action-setup@v4
1716
with:
1817
version: 9
1918
run_install: false
2019

21-
- name: Setup Node.js
20+
- name: Setup Node.js Version 20 (LTS)
2221
uses: actions/setup-node@v4
2322
with:
24-
node-version: 18
23+
node-version: 20
2524
cache: 'pnpm'
2625

27-
- name: Install dependencies and generate content JSON
26+
- name: Install Dependencies and Generate Content JSON
2827
run: |
2928
pnpm install
3029
npm run generate:roadmap-content-json
30+
3131
- name: Create PR
32-
uses: peter-evans/create-pull-request@v4
32+
uses: peter-evans/create-pull-request@v7
3333
with:
3434
delete-branch: false
3535
branch: "chore/update-content-json"
3636
base: "master"
3737
labels: |
3838
dependencies
3939
automated pr
40-
reviewers: kamranahmedse,arikchakma
40+
reviewers: kamranahmedse
4141
commit-message: "chore: update roadmap content json"
42-
title: "Update roadmap content json"
42+
title: "Updated Roadmap Content JSON - Automated"
4343
body: |
44-
Updates the roadmap content JSON files in the `public` folder.
45-
Please review the changes and merge if everything looks good.
44+
## Updated Roadmap Content JSON
45+
46+
> [!IMPORTANT]
47+
> This PR Updates the Roadmap Content JSON files stored in the `public` directory.
48+
>
49+
> Commit: ${{ github.sha }}
50+
> Workflow Path: ${{ github.workflow_ref }}
51+
52+
**Please Review the Changes and Merge the PR if everything is fine.**

.github/workflows/update-deps.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Upgrade Dependencies
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * 0'
7+
8+
jobs:
9+
upgrade-deps:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Node.js Version 20 (LTS)
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
19+
- name: Setup pnpm@v9
20+
uses: pnpm/action-setup@v4
21+
with:
22+
version: 9
23+
24+
- name: Install & Upgrade Dependencies
25+
run: |
26+
pnpm install
27+
npm run upgrade
28+
pnpm install --lockfile-only
29+
30+
- name: Create Pull Request
31+
uses: peter-evans/create-pull-request@v7
32+
with:
33+
delete-branch: false
34+
branch: "update-deps"
35+
base: "master"
36+
labels: |
37+
dependencies
38+
automated pr
39+
reviewers: kamranahmedse
40+
commit-message: "chore: update dependencies to latest"
41+
title: "Upgrade Dependencies To Latest - Automated"
42+
body: |
43+
## Updated all Dependencies to Latest Versions.
44+
45+
> [!IMPORTANT]
46+
> This PR Upgrades the Dependencies to the Latest Their Versions.
47+
>
48+
> Commit: ${{ github.sha }}
49+
> Workflow Path: ${{ github.workflow_ref }}
50+
51+
**Please Review the Changes and Merge the PR if everything is fine.**

0 commit comments

Comments
 (0)