Skip to content

Commit

Permalink
Merge pull request #65 from fiit-tp7-2023/AB#203-autodeploy-frontend
Browse files Browse the repository at this point in the history
AB#203 Autodeploy frontend
  • Loading branch information
Kesuera authored Dec 8, 2023
2 parents d2c5b1b + 014f04e commit 53f9c71
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 12 deletions.
7 changes: 4 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# REST API configuration
REST_API_URL=

# Auth configuration - required in production
AUTH_ORIGIN=
AUTH_SECRET=

# Google configuration
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REFRESH_TOKEN_URL=

# .NET backend runs locally on HTTPS (must be set to 0), for production must be set to 1
NODE_TLS_REJECT_UNAUTHORIZED=

# Authorization secret
AUTH_SECRET=
24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: SSH into the server, Github pull and update Docker setup
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script_stop: true
script: |
cd /usr/local/team07/presentation-web/frontend
git checkout main
git pull
docker compose down --rmi all
docker compose build --no-cache
docker compose up -d
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default defineNuxtConfig({
devtools: { enabled: true },
auth: {
enableGlobalAppMiddleware: process.env.VERCEL_ENV !== 'preview',
origin: process.env.NODE_ENV === 'production' ? 'https://frontend-tag.vercel.app' : 'http://localhost:3000',
origin: process.env.AUTH_ORIGIN ?? 'http://localhost:3000',
},
runtimeConfig: {
restApiUrl: process.env.REST_API_URL,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@nuxt/content": "^2.9.0",
"copy-to-clipboard": "^3.3.3",
"md-to-pdf": "^5.2.4",
"next-auth": "~4.22.5"
"next-auth": "4.21.1"
},
"husky": {
"hooks": {
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 53f9c71

Please sign in to comment.