2024-03-03 23:08:14 +00:00
|
|
|
name: Deploy Gemini Capsule
|
|
|
|
|
|
|
|
# only run on changes to main
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2024-03-23 19:07:18 +00:00
|
|
|
paths:
|
|
|
|
- 'gemlog/**'
|
|
|
|
- 'static/**'
|
|
|
|
- 'templates/**'
|
|
|
|
- 'gempost.yaml'
|
2024-03-03 23:08:14 +00:00
|
|
|
|
|
|
|
concurrency: # prevent concurrent deploys doing strange things
|
|
|
|
group: deploy-gemini-capsule
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
# Default to bash
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
name: Deploy Gemini Capsule
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Install gempost
|
|
|
|
uses: baptiste0928/cargo-install@v3.0.0
|
|
|
|
with:
|
|
|
|
crate: gempost
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Gempost build
|
|
|
|
run: gempost build
|
2024-03-15 15:49:01 +00:00
|
|
|
- name: Generate web feed
|
|
|
|
run: ./generate-web-feed.sh
|
2024-03-03 23:08:14 +00:00
|
|
|
- name: Connect to Tailscale
|
|
|
|
uses: tailscale/github-action@v2
|
|
|
|
with:
|
|
|
|
oauth-client-id: ${{ secrets.TS_API_CLIENT_ID }}
|
|
|
|
oauth-secret: ${{ secrets.TS_API_CLIENT_SECRET }}
|
|
|
|
tags: ${{ secrets.TS_TAG }}
|
2024-03-23 20:08:42 +00:00
|
|
|
- name: Configure SSH known hosts
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/.ssh
|
|
|
|
echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
|
|
|
|
chmod 644 ~/.ssh/known_hosts
|
2024-03-03 23:08:14 +00:00
|
|
|
- name: Deploy GMI to Agate
|
|
|
|
run: |
|
2024-03-03 23:14:02 +00:00
|
|
|
rsync -avz --delete -e ssh public/ deploy@${{ secrets.GMI_HOST }}:${{ secrets.GMI_CONTENT_PATH }}
|