forked from coredumped7893/excali-api
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.46 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
39
40
41
42
43
44
45
name: Docker Image and Deployment CI
on:
workflow_dispatch: # możliwość ręcznego odpalania
inputs:
only_env:
description: "Only update .env"
type: boolean
required: false
default: false
push: # na push do maina
branches:
- main
jobs:
build:
runs-on: self-hosted # alternatywnie podać dowolny z skonfigurowanych tagów jeśli jest kilka runnerów
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Build Docker image
if: inputs.only_env == false
run: sudo docker build . --tag excali-dev:latest -f Dockerfile
- name: Generate env
working-directory: ${{ secrets.DESTINATION_PATH }}
run: |
cat > .env <<EOF
CLIENT_ID=${{ secrets.CLIENT_ID }}
CLIENT_SECRET=${{ secrets.CLIENT_SECRET }}
CALL_BACK_URL=${{ secrets.CALL_BACK_URL }}
FRONT_APP_REDIRECT_URL=${{ secrets.FRONT_APP_REDIRECT_URL }}
CORS_ORIGIN=${{ secrets.CORS_ORIGIN }}
AUTH_GUARD_DISABLE=${{ secrets.AUTH_GUARD_DISABLE }}
AUTH_DEFAULT_USER_ID=${{ secrets.AUTH_DEFAULT_USER_ID }}
DEFAULT_USER_ROLE=${{ secrets.DEFAULT_USER_ROLE }}
AUTH_EMAIL_DOMAIN_WHITELIST=${{ secrets.AUTH_EMAIL_DOMAIN_WHITELIST }}
SHARED_TAG_NAME=${{ secrets.SHARED_TAG_NAME }}
EOF
- name: Run Docker image
working-directory: ${{ secrets.DESTINATION_PATH }}
run: docker compose up -d