-
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (53 loc) · 2.48 KB
/
plausible.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
46
47
48
49
50
51
52
53
54
55
56
57
58
name: deploy-plausible
on:
push:
paths:
- '.github/workflows/plausible.yml'
- 'plausible/**'
branches: [main]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: Plausible
url: https://pa.aosus.org
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Tailscale
uses: tailscale/github-action@7a0b30ed3517c2244d1330e39467b95f067a33bd
with:
oauth-client-id: ${{ secrets.TAILSCALE_CLIENT_ID }}
oauth-secret: ${{ secrets.TAILSCALE_SECRET }}
tags: tag:deploy-ci
hostname: Github-actions
version: ${{ vars.TAILSCALE_VERSION }}
- name: Add secrets to compose
env:
SECRET_KEY_BASE: ${{ secrets.plausible_secret_key_base }}
TOTP_VAULT_KEY: ${{ secrets.plausible_totp_vault_key }}
SMTP_USER_PWD: ${{ secrets.plausible_smtp_user_pwd }}
GOOGLE_CLIENT_ID: ${{ secrets.plausible_google_client_id }}
GOOGLE_CLIENT_SECRET: ${{ secrets.plausible_google_client_secret }}
POSTGRES_PASSWORD: ${{ secrets.plausible_postgres_password }}
MAXMIND_LICENSE_KEY: ${{ secrets.plausible_maxmind_license_key }}
run: |
sed -i "s|(plausible_secret_key_base)|$SECRET_KEY_BASE|g" $GITHUB_WORKSPACE/plausible/docker-compose.yml
sed -i "s|(plausible_totp_vault_key)|$TOTP_VAULT_KEY|g" $GITHUB_WORKSPACE/plausible/docker-compose.yml
sed -i "s|(plausible_smtp_user_pwd)|$SMTP_USER_PWD|g" $GITHUB_WORKSPACE/plausible/docker-compose.yml
sed -i "s|(plausible_google_client_id)|$GOOGLE_CLIENT_ID|g" $GITHUB_WORKSPACE/plausible/docker-compose.yml
sed -i "s|(plausible_google_client_secret)|$GOOGLE_CLIENT_SECRET|g" $GITHUB_WORKSPACE/plausible/docker-compose.yml
sed -i "s|(plausible_postgres_password)|$POSTGRES_PASSWORD|g" $GITHUB_WORKSPACE/plausible/docker-compose.yml
sed -i "s|(plausible_maxmind_license_key)|$MAXMIND_LICENSE_KEY|g" $GITHUB_WORKSPACE/plausible/docker-compose.yml
- name: Start Deployment
uses: FarisZR/[email protected]
with:
remote_docker_host: ${{ secrets.server_address }}
tailscale_ssh: true # no need for manual private and public keys
compose_file_path: plausible/docker-compose.yml
args: -p plausible up -d --remove-orphans
upload_directory: true
docker_compose_directory: plausible