Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dev_deploy.sh #715

Merged
merged 5 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- dev

jobs:
docker:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dev-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ jobs:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
./deploy_dev.sh next
cd hng_boilerplate_nextjs
./scripts/dev_deploy.sh
9 changes: 4 additions & 5 deletions docker/development/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
services:

next-dev-frontend-1:
build:
context: ../../
dockerfile: docker/development/Dockerfile
frontend:
image: hngdevops/nextjs-boilerplate:dev
ports:
- 3100:3000
restart: always
volumes:
- ../../.env:/app/.env

# next-dev-frontend-2:
# build:
Expand Down
25 changes: 5 additions & 20 deletions scripts/dev_deploy.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
#!/bin/bash

if [ "$#" -ne 1 ]; then
echo "Usage: $0 {next|remix}"
exit 1
fi

if [ "$1" == "next" ]; then
cd /home/nextjs/dev/hng_boilerplate_nextjs
git pull origin dev
docker compose -f docker/development/docker-compose.yml build
docker compose -f docker/development/docker-compose.yml up -d
elif [ "$1" == "remix" ]; then
cd /home/remixjs/dev/hng_boilerplate_remix
git pull origin dev
docker compose -f docker/development/docker-compose.yml build
docker compose -f docker/development/docker-compose.yml up -d
else
echo "Invalid argument. Use 'next' or 'remix'."
echo "Usage: $0 {next|remix}"
exit 1
fi
set -e

cd "$(git rev-parse --show-toplevel)"
git pull origin dev
docker pull hngdevops/nextjs-boilerplate:dev
docker compose --project-name dev-nextjs -f docker/development/docker-compose.yml up -d
Loading