Skip to content

Commit

Permalink
Refactor workflows (#92)
Browse files Browse the repository at this point in the history
* refactor workflows

* update packages
  • Loading branch information
OlivierJM authored Apr 21, 2024
1 parent b969914 commit 1effb8d
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 18,537 deletions.
28 changes: 4 additions & 24 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
name: Deployment

"on":
push:
branches:
- release
on:
release:
types: [published]
env:
REMOTE: ${{secrets.USERNAME}}@${{secrets.HOST}}

jobs:
deploy:
if: "!contains(github.event.commits[0].message, '[skip-ci]')"
runs-on: ubuntu-latest
container:
container:
image: debian:latest

steps:
Expand Down Expand Up @@ -100,22 +99,3 @@ jobs:
yarn; # Install dependencies
forever start -c "yarn start" ./; # Restart the application
'
# - name: Deploy Build
# if: steps.build.exit_code == 0
# run: |
# echo '${{secrets.DEPLOYKEY}}' > deploy_key
# chmod 600 ./deploy_key
# rsync -chav --exclude='node_modules/' \
# -e 'ssh -i ./deploy_key -o StrictHostKeyChecking=no' \
# ./ ${{env.REMOTE}}:${{secrets.DESTINATION}}
#run: find . -type f ! -path './node_modules/*' ! -path './.git/*' ! -path './.next/cache/*' -print
# run: |
# echo "list of all your files"
# ls -la
# find . -type f ! -path './node_modules/*' ! -path './.git/*' ! -path './.next/cache/*' -print
# echo '${{secrets.DEPLOYKEY}}' > deploy_key
# chmod 600 ./deploy_key
# find . -type d \( -path './node_modules'\) -prune -o -type f -print | xargs scp -i ./deploy_key -o StrictHostKeyChecking=no -r ${{env.REMOTE}}:${{secrets.DESTINATION}}

# - name: Restart Application
# run: ssh -i ./deploy_key -o 'StrictHostKeyChecking no' -v ${{env.REMOTE}} 'cd ${{secrets.DESTINATION}};yarn;pm2 restart 0'
18 changes: 15 additions & 3 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Check code sanity

on:
push:
branches: ["main"]
branches: ['main']
pull_request:
branches: ["main"]
branches: ['main']

jobs:
build:
Expand Down Expand Up @@ -38,4 +38,16 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn lint
- name: Create Local Build
if: steps.tests.exit_code == 0
id: build
run: yarn build
env:
MONGODB_URI: ${{ secrets.MONGODB_URI }}
EMAIL_FROM: ${{ secrets.EMAIL_FROM }}
EMAIL_SERVER: ${{ secrets.EMAIL_SERVER }}
MONGODB_DB: ${{ secrets.MONGODB_DB }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }}
REALM_APP_ID: ${{ secrets.REALM_APP_ID }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ yarn-error.log*
next-env.d.ts
mongodb-realm
.env
.env.test
.env.test
package-lock.json
Loading

0 comments on commit 1effb8d

Please sign in to comment.