-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1057 from hngprojects/dev
Merge to staging
- Loading branch information
Showing
330 changed files
with
21,329 additions
and
22,770 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: Anchor Deployment | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Build and Upload"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
deploy_to_java: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: "anchor-java" | ||
url: ${{ vars.URL }} | ||
|
||
steps: | ||
- name: Download build artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
run-id: ${{ github.event.workflow_run.id }} | ||
name: boilerplate-build | ||
path: . | ||
|
||
- name: Decode and create .env file | ||
run: | | ||
echo ${{ secrets.ENV }} | base64 -d > .env.java | ||
- name: Copy Artifacts to server | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
source: ".env.java,boilerplate.tar.gz" | ||
target: "/tmp/java" | ||
|
||
- name: Deploy on server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
script: | | ||
cd hng_boilerplate_nextjs | ||
tar -xzf /tmp/java/boilerplate.tar.gz | ||
mv /tmp/java/.env.java .env | ||
rm -f /tmp/java/boilerplate.tar.gz | ||
cp -r .next/standalone/* . | ||
pm2 restart nextjs_boilerplate --update-env | ||
deploy_to_python: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: "anchor-python" | ||
url: ${{ vars.URL }} | ||
|
||
steps: | ||
- name: Download build artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
run-id: ${{ github.event.workflow_run.id }} | ||
name: boilerplate-build | ||
path: . | ||
|
||
- name: Decode and create .env file | ||
run: | | ||
echo ${{ secrets.ENV }} | base64 -d > .env.python | ||
- name: Copy Artifacts to server | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
source: ".env.python,boilerplate.tar.gz" | ||
target: "/tmp/python" | ||
|
||
- name: Deploy on server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
script: | | ||
cd hng_boilerplate_nextjs | ||
tar -xzf /tmp/python/boilerplate.tar.gz | ||
mv /tmp/python/.env.python .env | ||
rm -f /tmp/python/boilerplate.tar.gz | ||
cp -r .next/standalone/* . | ||
pm2 restart nextjs_boilerplate --update-env |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Build and Upload | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: github.event.repository.fork == false | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
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 | ||
with: | ||
version: 9 | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build Next.js application | ||
run: pnpm build | ||
|
||
- name: Archive production artifacts | ||
run: tar -czf boilerplate.tar.gz .next public | ||
|
||
- name: Upload production artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: boilerplate-build | ||
path: boilerplate.tar.gz | ||
|
||
- name: Delete zip file | ||
run: rm -f boilerplate.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Bulldozer PHP Deployment | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_run: | ||
workflows: ["Build and Upload"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
deploy_boilerplate_frontend: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: "bulldozer-php" | ||
url: ${{ vars.URL }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download build artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
run-id: ${{ github.event.workflow_run.id }} | ||
name: boilerplate-build | ||
path: . | ||
|
||
|
||
- name: Copy Artifacts to server | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
source: "boilerplate.tar.gz" | ||
target: "/var/www/boilerplate_fe/dev" | ||
|
||
- name: Deploy on server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
script: | | ||
cd /var/www/boilerplate_fe/dev | ||
rm -rf .next | ||
rm -rf public | ||
tar -xzf boilerplate.tar.gz | ||
rm -f boilerplate.tar.gz | ||
pm2 restart boilerplate-frontend --update-env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,26 +2,50 @@ name: Dev Deployment | |
|
||
on: | ||
workflow_run: | ||
workflows: ["Build and Push"] | ||
workflows: ["Buil and Upload"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
jobs: | ||
deploy_to_dev: | ||
if: github.event.repository.fork == false | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: "dev" | ||
url: ${{ vars.URL }} | ||
|
||
steps: | ||
- name: Deploy to dev environment | ||
uses: appleboy/[email protected] | ||
- name: Download build artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
run-id: ${{ github.event.workflow_run.id }} | ||
name: boilerplate-build | ||
path: . | ||
|
||
- name: Decode and create .env file | ||
run: | | ||
echo ${{ secrets.ENV_BASE64 }} | base64 -d > .env | ||
- name: Copy Artifacts to server | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
source: ".env,boilerplate.tar.gz" | ||
target: "~/hng_boilerplate_nextjs" | ||
|
||
- name: Deploy on server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
script: | | ||
cd hng_boilerplate_nextjs | ||
./scripts/dev_deploy.sh | ||
cd ~/hng_boilerplate_nextjs | ||
tar -xzf boilerplate.tar.gz | ||
rm -f boilerplate.tar.gz | ||
cp -r .next/standalone/* . | ||
# pm2 restart nextjs_boilerplate --update-env |
Oops, something went wrong.