-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (34 loc) · 1.21 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Deploy to Server
on:
push:
branches:
- main
jobs:
deploy:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up environment variables
env:
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_NAME: ${{ secrets.DB_NAME }}
DB_USER: ${{ secrets.DB_USER }}
SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
GITHUB_CLIENT_ID: ${{ secrets._GITHUB_CLIENT_ID }}
GITHUB_CLIENT_SECRET: ${{ secrets._GITHUB_CLIENT_SECRET }}
ORIGIN_URL: ${{ secrets.ORIGIN_URL }}
TUNNEL_TOKEN: ${{ secrets.TUNNEL_TOKEN }}
run: |
echo "DB_PASSWORD='${DB_PASSWORD}'" >> .env
echo "DB_NAME='${DB_NAME}'" >> .env
echo "DB_USER='${DB_USER}'" >> .env
echo "SESSION_SECRET='${SESSION_SECRET}'" >> .env
echo "GITHUB_CLIENT_ID='${GITHUB_CLIENT_ID}'" >> .env
echo "GITHUB_CLIENT_SECRET='${GITHUB_CLIENT_SECRET}'" >> .env
echo "ORIGIN_URL='${ORIGIN_URL}'" >> .env
echo "TUNNEL_TOKEN='${TUNNEL_TOKEN}'" >> .env
- name: Build and deploy
run: |
docker-compose build
docker-compose up -d