mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-02 05:42:41 +02:00
chore: enhanced workflows (#6977)
* Enhanced Workflows. * Changed the PR Reviewer to the Final Boss.
This commit is contained in:
35
.github/workflows/deployment.yml
vendored
35
.github/workflows/deployment.yml
vendored
@@ -1,24 +1,26 @@
|
|||||||
name: Deploy to EC2
|
name: Deploy to EC2
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # allow manual run
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
- uses: pnpm/action-setup@v3.0.0
|
- uses: pnpm/action-setup@v4.0.0
|
||||||
with:
|
with:
|
||||||
version: 8.15.6
|
version: 9
|
||||||
|
|
||||||
# --------------------
|
# -------------------
|
||||||
# Setup configuration
|
# Setup configuration
|
||||||
# --------------------
|
# -------------------
|
||||||
- name: Prepare configuration files
|
- name: Prepare configuration files
|
||||||
run: |
|
run: |
|
||||||
git clone https://${{ secrets.GH_PAT }}@github.com/roadmapsh/infra-config.git configuration --depth 1
|
git clone https://${{ secrets.GH_PAT }}@github.com/roadmapsh/infra-config.git configuration --depth 1
|
||||||
@@ -26,13 +28,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cp configuration/dist/github/developer-roadmap.env .env
|
cp configuration/dist/github/developer-roadmap.env .env
|
||||||
|
|
||||||
# --------------------
|
# -----------------
|
||||||
# Prepare the build
|
# Prepare the Build
|
||||||
# --------------------
|
# -----------------
|
||||||
- name: Install dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
pnpm install
|
pnpm install
|
||||||
- name: Generate build
|
|
||||||
|
- name: Generate Production Build
|
||||||
run: |
|
run: |
|
||||||
git clone https://${{ secrets.GH_PAT }}@github.com/roadmapsh/web-draw.git .temp/web-draw --depth 1
|
git clone https://${{ secrets.GH_PAT }}@github.com/roadmapsh/web-draw.git .temp/web-draw --depth 1
|
||||||
npm run generate-renderer
|
npm run generate-renderer
|
||||||
@@ -45,7 +48,7 @@ jobs:
|
|||||||
- uses: webfactory/ssh-agent@v0.7.0
|
- uses: webfactory/ssh-agent@v0.7.0
|
||||||
with:
|
with:
|
||||||
ssh-private-key: ${{ secrets.EC2_PRIVATE_KEY }}
|
ssh-private-key: ${{ secrets.EC2_PRIVATE_KEY }}
|
||||||
- name: Deploy app to EC2
|
- name: Deploy Application to EC2
|
||||||
run: |
|
run: |
|
||||||
rsync -apvz --delete --no-times --exclude "configuration" -e "ssh -o StrictHostKeyChecking=no" -p ./ ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }}:/var/www/roadmap.sh/
|
rsync -apvz --delete --no-times --exclude "configuration" -e "ssh -o StrictHostKeyChecking=no" -p ./ ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }}:/var/www/roadmap.sh/
|
||||||
- name: Restart PM2
|
- name: Restart PM2
|
||||||
@@ -58,9 +61,9 @@ jobs:
|
|||||||
cd /var/www/roadmap.sh
|
cd /var/www/roadmap.sh
|
||||||
sudo pm2 restart web-roadmap
|
sudo pm2 restart web-roadmap
|
||||||
|
|
||||||
# --------------------
|
# ----------------------
|
||||||
# Clear cloudfront cache
|
# Clear cloudfront cache
|
||||||
# --------------------
|
# ----------------------
|
||||||
- name: Clear Cloudfront Caching
|
- name: Clear Cloudfront Caching
|
||||||
run: |
|
run: |
|
||||||
curl -L \
|
curl -L \
|
||||||
|
6
.github/workflows/label-issue.yml
vendored
6
.github/workflows/label-issue.yml
vendored
@@ -1,13 +1,15 @@
|
|||||||
name: Label Issue
|
name: Label Issue
|
||||||
|
|
||||||
on:
|
on:
|
||||||
issues:
|
issues:
|
||||||
types: [ opened, edited ]
|
types: [ opened, edited ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
label-topic-change-issue:
|
label-topic-change-issue:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Add roadmap slug to issue as label
|
- name: Add Labels To Issue
|
||||||
uses: actions/github-script@v3
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
|
@@ -1,35 +1,35 @@
|
|||||||
name: Refreshes roadmap content JSON
|
name: Refresh Roadmap Content JSON
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # allow manual run
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * *' # every day at midnight
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
upgrade-deps:
|
refresh-content:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm@v9
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 9
|
version: 9
|
||||||
run_install: false
|
run_install: false
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js Version 20 (LTS)
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 20
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install dependencies and generate content JSON
|
- name: Install Dependencies and Generate Content JSON
|
||||||
run: |
|
run: |
|
||||||
pnpm install
|
pnpm install
|
||||||
npm run generate:roadmap-content-json
|
npm run generate:roadmap-content-json
|
||||||
|
|
||||||
- name: Create PR
|
- name: Create PR
|
||||||
uses: peter-evans/create-pull-request@v4
|
uses: peter-evans/create-pull-request@v7
|
||||||
with:
|
with:
|
||||||
delete-branch: false
|
delete-branch: false
|
||||||
branch: "chore/update-content-json"
|
branch: "chore/update-content-json"
|
||||||
@@ -37,9 +37,16 @@ jobs:
|
|||||||
labels: |
|
labels: |
|
||||||
dependencies
|
dependencies
|
||||||
automated pr
|
automated pr
|
||||||
reviewers: kamranahmedse,arikchakma
|
reviewers: kamranahmedse
|
||||||
commit-message: "chore: update roadmap content json"
|
commit-message: "chore: update roadmap content json"
|
||||||
title: "Update roadmap content json"
|
title: "Updated Roadmap Content JSON - Automated"
|
||||||
body: |
|
body: |
|
||||||
Updates the roadmap content JSON files in the `public` folder.
|
## Updated Roadmap Content JSON
|
||||||
Please review the changes and merge if everything looks good.
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> This PR Updates the Roadmap Content JSON files stored in the `public` directory.
|
||||||
|
>
|
||||||
|
> Commit: ${{ github.sha }}
|
||||||
|
> Workflow Path: ${{ github.workflow_ref }}
|
||||||
|
|
||||||
|
**Please Review the Changes and Merge the PR if everything is fine.**
|
38
.github/workflows/update-deps.yml
vendored
38
.github/workflows/update-deps.yml
vendored
@@ -1,38 +0,0 @@
|
|||||||
name: Update dependencies
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch: # allow manual run
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 * * 0' # every sunday at midnight
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
upgrade-deps:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
- uses: pnpm/action-setup@v2.2.2
|
|
||||||
with:
|
|
||||||
version: 7.13.4
|
|
||||||
- name: Upgrade dependencies
|
|
||||||
run: |
|
|
||||||
pnpm install
|
|
||||||
npm run upgrade
|
|
||||||
pnpm install --lockfile-only
|
|
||||||
- name: Create PR
|
|
||||||
uses: peter-evans/create-pull-request@v4
|
|
||||||
with:
|
|
||||||
delete-branch: false
|
|
||||||
branch: "update-deps"
|
|
||||||
base: "master"
|
|
||||||
labels: |
|
|
||||||
dependencies
|
|
||||||
automated pr
|
|
||||||
reviewers: kamranahmedse
|
|
||||||
commit-message: "chore: update dependencies to latest"
|
|
||||||
title: "Upgrade dependencies to latest"
|
|
||||||
body: |
|
|
||||||
Updates all dependencies to latest versions.
|
|
||||||
Please review the changes and merge if everything looks good.
|
|
51
.github/workflows/upgrade-dependencies.yml
vendored
Normal file
51
.github/workflows/upgrade-dependencies.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
name: Upgrade Dependencies
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * 0'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
upgrade-deps:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js Version 20 (LTS)
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
|
||||||
|
- name: Setup pnpm@v9
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 9
|
||||||
|
|
||||||
|
- name: Install & Upgrade Dependencies
|
||||||
|
run: |
|
||||||
|
pnpm install
|
||||||
|
npm run upgrade
|
||||||
|
pnpm install --lockfile-only
|
||||||
|
|
||||||
|
- name: Create Pull Request
|
||||||
|
uses: peter-evans/create-pull-request@v7
|
||||||
|
with:
|
||||||
|
delete-branch: false
|
||||||
|
branch: "update-deps"
|
||||||
|
base: "master"
|
||||||
|
labels: |
|
||||||
|
dependencies
|
||||||
|
automated pr
|
||||||
|
reviewers: kamranahmedse
|
||||||
|
commit-message: "chore: update dependencies to latest"
|
||||||
|
title: "Upgrade Dependencies To Latest - Automated"
|
||||||
|
body: |
|
||||||
|
## Updated all Dependencies to Latest Versions.
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> This PR Upgrades the Dependencies to the Latest Their Versions.
|
||||||
|
>
|
||||||
|
> Commit: ${{ github.sha }}
|
||||||
|
> Workflow Path: ${{ github.workflow_ref }}
|
||||||
|
|
||||||
|
**Please Review the Changes and Merge the PR if everything is fine.**
|
Reference in New Issue
Block a user