-
Notifications
You must be signed in to change notification settings - Fork 4
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 #38 from Black-Dot-2024/fix/github-actions
Fix github actions
- Loading branch information
Showing
8 changed files
with
123 additions
and
94 deletions.
There are no files selected for viewing
Empty file.
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 |
---|---|---|
|
@@ -9,28 +9,28 @@ jobs: | |
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
- name: Install PNPM | ||
run: npm install -g pnpm | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
node-version: '20.x' | ||
cache: 'pnpm' | ||
|
||
- name: Install pnpm | ||
run: npm install -g pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
run: pnpm install --no-frozen-lockfile | ||
|
||
- name: Check for leaked secrets | ||
uses: zricethezav/[email protected] | ||
|
||
- name: Prisma Generate | ||
run: pnpm run prisma:generate | ||
|
||
- name: Compile | ||
run: pnpm run build | ||
|
||
|
@@ -47,16 +47,3 @@ jobs: | |
fi | ||
env: | ||
CI: true | ||
|
||
- name: Comment PR with test results | ||
if: github.event_name == 'pull_request' | ||
uses: unsplash/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
msg: | | ||
📝 **Test Results:** | ||
``` | ||
${{ steps.run_tests.outputs.result }} | ||
``` | ||
check_for_duplicate_messages: true |
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,44 @@ | ||
name: Deploy to EC2 | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
|
||
- name: Install PNPM | ||
run: npm install -g pnpm | ||
|
||
- name: Copy files to EC2 | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.EC2_HOST }} | ||
username: ${{ secrets.EC2_USER }} | ||
key: ${{ secrets.EC2_SSH_KEY }} | ||
port: 22 | ||
source: '.' | ||
target: '/home/ubuntu/Zeitgeist-Backend' | ||
|
||
- name: Deploy application | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.EC2_HOST }} | ||
username: ${{ secrets.EC2_USER }} | ||
key: ${{ secrets.EC2_SSH_KEY }} | ||
port: 22 | ||
script: | | ||
cd /home/ubuntu/Zeitgeist-Backend | ||
git pull origin main | ||
pnpm install | ||
pnpm run build | ||
pm2 reload "production" |
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,44 @@ | ||
name: Deploy to EC2 | ||
|
||
on: | ||
push: | ||
branches: | ||
- staging | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
|
||
- name: Install PNPM | ||
run: npm install -g pnpm | ||
|
||
- name: Copy files to EC2 | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.EC2_HOST }} | ||
username: ${{ secrets.EC2_USER }} | ||
key: ${{ secrets.EC2_SSH_KEY }} | ||
port: 22 | ||
source: '.' | ||
target: '/home/ubuntu/Staging-Zeitgeist-Backend' | ||
|
||
- name: Deploy application | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.EC2_HOST }} | ||
username: ${{ secrets.EC2_USER }} | ||
key: ${{ secrets.EC2_SSH_KEY }} | ||
port: 22 | ||
script: | | ||
cd /home/ubuntu/Staging-Zeitgeist-Backend | ||
git pull origin staging | ||
pnpm install | ||
pnpm run build | ||
pm2 reload "staging" |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -1,12 +1,9 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"module": "CommonJS", | ||
"outDir": "./dist", | ||
"esModuleInterop": true, | ||
"strict": true, | ||
"skipLibCheck": true | ||
"module": "commonjs", | ||
"target": "es6", | ||
"esModuleInterop": true | ||
}, | ||
"include": ["src/**/__tests__/**/*.ts"], | ||
"exclude": ["node_modules", "dist", "./tests"] | ||
"include": ["src/**/*"] | ||
} |