forked from s1lvax/route
-
Notifications
You must be signed in to change notification settings - Fork 0
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 s1lvax#52 from s1lvax/dev
merge new changes
- Loading branch information
Showing
9 changed files
with
138 additions
and
38 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Deploy Dev App | ||
#deploy dev branch | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Copy repository to SFTP | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.SFTP_HOST }} | ||
username: ${{ secrets.SFTP_USER }} | ||
password: ${{ secrets.SFTP_PASSWORD }} | ||
port: ${{ secrets.SFTP_PORT }} | ||
source: '.' | ||
target: '/opt/route-dev' | ||
|
||
- name: Build and deploy Docker container | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SFTP_HOST }} | ||
username: ${{ secrets.SFTP_USER }} | ||
password: ${{ secrets.SFTP_PASSWORD }} | ||
port: ${{ secrets.SFTP_PORT }} | ||
script: | | ||
cd '/opt/route-dev' | ||
# Overwrite the .env file to recreate it during each deployment | ||
rm -f .env | ||
echo "AUTH_SECRET=${{ secrets.AUTH_SECRET_TESTING }}" >> .env | ||
echo "CLIENT_ID=${{ secrets.CLIENT_ID_TESTING }}" >> .env | ||
echo "CLIENT_SECRET=${{ secrets.CLIENT_SECRET_TESTING }}" >> .env | ||
echo "DATABASE_URL=${{ secrets.DATABASE_URL_TESTING }}" >> .env | ||
echo "AUTH_TRUST_HOST=${{ secrets.AUTH_TRUST_HOST }}" >> .env | ||
#Prisma | ||
npx prisma generate | ||
docker build -t route-dev . | ||
docker stop route-dev || true | ||
docker rm route-dev || true | ||
docker run -d --name route-dev --restart always --env-file .env -p 3003:3000 route-dev |
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
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
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,4 @@ | ||
export interface MasteryLevel { | ||
value: string; | ||
label: string; | ||
} |
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,10 @@ | ||
import { masteryLevels } from '$lib/constants/masteryLevel'; | ||
import type { MasteryLevel } from '$lib/types/MasteryLevel'; | ||
|
||
export const getMasteryLevelFromLabel = (label: string): MasteryLevel | undefined => { | ||
return masteryLevels.find((masteryLevel) => masteryLevel.label == label); | ||
}; | ||
|
||
export const getMasteryLevelFromLevel = (level: string): MasteryLevel | undefined => { | ||
return masteryLevels.find((masteryLevel) => masteryLevel.value == level); | ||
}; |
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