This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
[skipc ci] update file structure to match host. #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy-discourse | |
on: | |
push: | |
paths: | |
- '.github/workflows/discourse.yml' | |
- 'discourse/app.yml' | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
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 config files | |
env: | |
DISCOURSE_SMTP_PASSWORD: ${{ secrets.DISCOURSE_SMTP_PASSWORD }} | |
DISCOURSE_DB_PASSWORD: ${{ secrets.DISCOURSE_DB_PASSWORD }} | |
DISCOURSE_MAXMIND_LICENSE_KEY: ${{ secrets.DISCOURSE_MAXMIND_LICENSE_KEY }} | |
DISCOURSE_S3_ENDPOINT: ${{ secrets.DISCOURSE_S3_ENDPOINT }} | |
DISCOURSE_S3_SECRET_ACCESS_KEY: ${{ secrets.DISCOURSE_S3_SECRET_ACCESS_KEY }} | |
DISCOURSE_S3_ACCESS_KEY_ID: ${{ secrets.DISCOURSE_S3_ACCESS_KEY_ID }} | |
run: | | |
sed -i "s|(DISCOURSE_SMTP_PASSWORD)|$DISCOURSE_SMTP_PASSWORD|g" $GITHUB_WORKSPACE/discourse/app.yml | |
sed -i "s|(DISCOURSE_DB_PASSWORD)|$DISCOURSE_DB_PASSWORD|g" $GITHUB_WORKSPACE/discourse/app.yml | |
sed -i "s|(DISCOURSE_MAXMIND_LICENSE_KEY)|$DISCOURSE_MAXMIND_LICENSE_KEY|g" $GITHUB_WORKSPACE/discourse/app.yml | |
sed -i "s|(DISCOURSE_S3_ENDPOINT)|$DISCOURSE_S3_ENDPOINT|g" $GITHUB_WORKSPACE/discourse/app.yml | |
sed -i "s|(DISCOURSE_S3_SECRET_ACCESS_KEY)|$DISCOURSE_S3_SECRET_ACCESS_KEY|g" $GITHUB_WORKSPACE/discourse/app.yml | |
sed -i "s|(DISCOURSE_S3_ACCESS_KEY_ID)|$DISCOURSE_S3_ACCESS_KEY_ID|g" $GITHUB_WORKSPACE/discourse/app.yml | |
sed -i "s|(DISCOURSE_DB_PASSWORD)|$DISCOURSE_DB_PASSWORD|g" $GITHUB_WORKSPACE/discourse/db.yml | |
- name: Start Deployment | |
uses: FarisZR/Tailscale-ssh-deploy@main | |
with: | |
remote_host: ${{ secrets.server_address }} | |
directory: discourse/containers | |
post_upload_command: /home/aosus/discourse/launcher rebuild app | |
remote_destination: /home/aosus/discourse |