Skip to content

Commit

Permalink
Merge pull request #1572 from hngprojects/Ravencodess-patch-1
Browse files Browse the repository at this point in the history
chore: Re Architected and optimized pipeline
  • Loading branch information
Ravencodess authored Sep 13, 2024
2 parents ac00546 + 2ee510e commit 4b7c215
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 81 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/anchor-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Anchor Deployment

on:
workflow_run:
workflows: ["Build and Upload"]
types:
- completed
workflow_dispatch:
# workflow_run:
# workflows: ["Build and Upload"]
# types:
# - completed

jobs:
deploy_to_java:
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/build-and-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Build and Upload

on:
push:
branches:
- dev
branches: [staging, main]

jobs:
build:
Expand All @@ -18,14 +17,6 @@ jobs:
with:
node-version: "20"

- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: "20"

- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-

- name: Install pnpm
uses: pnpm/action-setup@v4
Expand All @@ -35,8 +27,8 @@ jobs:
- name: Lint code
run: pnpm lint

- name: Build email
run: pnpm email:build
# - name: Build email
# run: pnpm email:build

- name: Build project
run: pnpm build
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/bulldozer-php-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Bulldozer PHP Deployment

on:
workflow_dispatch:
workflow_run:
workflows: ["Build and Upload"]
types:
- completed
# workflow_run:
# workflows: ["Build and Upload"]
# types:
# - completed

jobs:
deploy_boilerplate_frontend:
Expand Down Expand Up @@ -50,4 +50,4 @@ jobs:
rm -rf public
tar -xzf boilerplate.tar.gz
rm -f boilerplate.tar.gz
pm2 restart boilerplate-frontend --update-env
pm2 restart boilerplate-frontend --update-env
9 changes: 5 additions & 4 deletions .github/workflows/dev-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Dev Deployment

on:
workflow_run:
workflows: ["Buil and Upload"]
types:
- completed
workflow_dispatch:
# workflow_run:
# workflows: ["Build and Upload"]
# types:
# - completed

jobs:
deploy_to_dev:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/kimiko-csharp-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Kimiko Csharp Deployment

on:
workflow_dispatch:
workflow_run:
workflows: ["Build and Upload"]
types:
- completed
# workflow_run:
# workflows: ["Build and Upload"]
# types:
# - completed

jobs:
deploy_boilerplate_frontend:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/kimiko-golang-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Kimiko Golang Deployment

on:
workflow_dispatch:
workflow_run:
workflows: ["Build and Upload"]
types:
- completed
# workflow_run:
# workflows: ["Build and Upload"]
# types:
# - completed

jobs:
deploy_boilerplate_frontend:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/phoenix-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Pheonix Deployment

on:
workflow_run:
workflows: ["Build and Upload"]
types:
- completed
workflow_dispatch:
# workflow_run:
# workflows: ["Build and Upload"]
# types:
# - completed

jobs:
deploy:
Expand Down
26 changes: 12 additions & 14 deletions .github/workflows/production-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@ name: Production Deployment

on:
workflow_dispatch:
push:
workflow_run:
workflows: ["Build and Upload"]
types:
- completed
branches:
- main
paths-ignore:
- .github/workflows/**

jobs:
build:
runs-on: ubuntu-latest

if: ${{ github.ref == 'refs/heads/main'}} && ${{ github.event.workflow_run.conclusion == 'success' }}

environment:
name: "production"
url: ${{ vars.URL }}

steps:
- uses: actions/checkout@v4

Expand All @@ -20,14 +26,6 @@ jobs:
with:
node-version: "20"

- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
Expand All @@ -53,7 +51,7 @@ jobs:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
source: "nextjs-prod.tar.gz"
target: "~/hng_boilerplate_nextjs"
target: "~/hng_boilerplate_nextjs/prod"

- name: Delete zip file
run: rm -f nextjs-prod.tar.gz
Expand All @@ -65,7 +63,7 @@ jobs:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd ~/hng_boilerplate_nextjs
cd ~/hng_boilerplate_nextjs/prod
tar -xzf nextjs-prod.tar.gz
rm -f nextjs-prod.tar.gz
cp -r .next/standalone/* .
Expand Down
21 changes: 7 additions & 14 deletions .github/workflows/staging-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ name: Staging Deployment

on:
workflow_dispatch:
push:
workflow_run:
workflows: ["Build and Upload"]
types:
- completed
branches:
- staging
paths-ignore:
- .github/workflows/**

jobs:
build:
runs-on: ubuntu-latest
if: github.event.repository.fork == false
if: ${{ github.ref == 'refs/heads/staging'}} && ${{ github.event.workflow_run.conclusion == 'success' }}

environment:
name: "staging"
Expand All @@ -25,14 +26,6 @@ jobs:
with:
node-version: "20"

- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
Expand All @@ -58,7 +51,7 @@ jobs:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
source: "nextjs-staging.tar.gz"
target: "~/hng_boilerplate_nextjs"
target: "~/hng_boilerplate_nextjs/staging"

- name: Delete zip file
run: rm -f nextjs-staging.tar.gz
Expand All @@ -70,7 +63,7 @@ jobs:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd ~/hng_boilerplate_nextjs
cd ~/hng_boilerplate_nextjs/staging
tar -xzf nextjs-staging.tar.gz
rm -f nextjs-staging.tar.gz
cp -r .next/standalone/* .
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/starlight-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Starlight Deployment

on:
workflow_run:
workflows: ["Build and Upload"]
types:
- completed
workflow_dispatch:
# workflow_run:
# workflows: ["Build and Upload"]
# types:
# - completed

jobs:
deploy_to_nestsjs:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/team-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Team Deployment

on:
workflow_run:
workflows: ["Build-and-Upload"]
types:
- completed
workflow_dispatch:
# workflow_run:
# workflows: ["Build and Upload"]
# types:
# - completed

jobs:
kimiko-golang:
Expand Down

0 comments on commit 4b7c215

Please sign in to comment.