Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

add plausible

add plausible #2

Workflow file for this run

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 }}
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_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