diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e6fec62..035b9fc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,7 +2,7 @@ name: deploy on: push: - branches: '*' + branches: 'main' jobs: deplou: @@ -30,9 +30,21 @@ jobs: - name: Copy docker files on server run: | scp -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa Dockerfile compose.yaml ${{ secrets.USERNAME }}@${{ secrets.HOST }}:~ + - name: Create env file + run: | + ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "mkdir secrets" + ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "echo PGPASSWORD=${{ secrets.PASS }} > ./secrets/pg.env" + ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "echo PGUSER=epm2m2 >> ./secrets/pg.env" + ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "echo PGPORT=5432 >> ./secrets/pg.env" + ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "echo PGDATABASE=ep2m2db >> ./secrets/pg.env" + ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "echo POSTGRES_PASSWORD=${{ secrets.PASS }} >> ./secrets/pg.env" + ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "echo POSTGRES_USER=epm2m2 >> ./secrets/pg.env" - name: RUN on server run: | - ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "echo ${{ secrets.PASS }}| sudo -S docker compose -f \"compose.yaml\" up -d --build" + ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "docker compose -f \"compose.yaml\" up -d --build" + - name: Delete files + run: | ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "rm -rf ~/.output" ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "rm Dockerfile" ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "rm compose.yaml" + ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "rm -rf ./secrets" diff --git a/.gitignore b/.gitignore index 3344745..a109b22 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ logs # sample file sample/* .vscode/settings.json +secrets/pg.env diff --git a/Dockerfile b/Dockerfile index 5d1b60f..441a881 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,4 +5,5 @@ EXPOSE 3000 RUN mkdir /results ENV EP2M2_DIR_SHARE=/shareFile ENV EP2M2_DIR_RESULT=/results -CMD [ "node", "./server/index.mjs" ] \ No newline at end of file +ENV PGHOST=db +CMD ["node", "./server/index.mjs"] diff --git a/app.vue b/app.vue index 50efa66..9d30c0e 100644 --- a/app.vue +++ b/app.vue @@ -9,11 +9,41 @@ import banner from "./components/BannerMain.vue"; import extras from "./components/ExtrasNav.vue"; import extract from "./components/ExtractInfo.vue"; +import login from "./components/LoginForm.vue"; +import { useCookie } from "nuxt/app"; + +