-
Notifications
You must be signed in to change notification settings - Fork 192
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 #773 from hngprojects/ci/refactor
ci: improve base compose.yaml
- Loading branch information
Showing
34 changed files
with
443 additions
and
1,523 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -391,7 +391,3 @@ dist | |
# /.env | ||
/.env.*.local | ||
*._local.ts | ||
|
||
# Migrations | ||
/db/migrations/*-migration.ts | ||
/db |
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,47 @@ | ||
name: Dev Deployment | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
build-and-push: | ||
if: github.event.repository.fork == false | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build Docker image | ||
run: docker build -t nestjs_dev:green . | ||
|
||
- name: Save and compress Docker image | ||
run: | | ||
docker save nestjs_dev:green | gzip > nestjs_dev.tar.gz | ||
- name: Copy image to server | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
source: "nestjs_dev.tar.gz" | ||
target: "/tmp" | ||
|
||
deploy: | ||
needs: build-and-push | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: "dev" | ||
url: ${{ vars.URL }} | ||
steps: | ||
- name: Deploy on server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
script: | | ||
./deploy.sh dev |
This file was deleted.
Oops, something went wrong.
22 changes: 9 additions & 13 deletions
22
.github/workflows/ci.yml → .github/workflows/lint-build-test.yaml
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 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,27 @@ | ||
name: PR Deploy | ||
on: | ||
pull_request_target: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
deploy-pr-for-testing: | ||
environment: | ||
name: preview | ||
url: ${{ steps.deploy.outputs.preview-url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout to branch | ||
uses: actions/checkout@v4 | ||
- id: deploy | ||
name: Pull Request Deploy | ||
uses: hngprojects/pr-deploy@dev | ||
with: | ||
server_host: ${{ secrets.HOST }} | ||
server_username: ${{ secrets.USERNAME }} | ||
server_password: ${{ secrets.PASSWORD }} | ||
comment: false | ||
context: . | ||
dockerfile: Dockerfile | ||
exposed_port: 5000 | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.