aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/deploy.yml35
1 files changed, 35 insertions, 0 deletions
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
new file mode 100644
index 0000000..5237dc7
--- /dev/null
+++ b/.github/workflows/deploy.yml
@@ -0,0 +1,35 @@
+# .github/workflows/deploy.yml
+name: Deploy
+
+on:
+ push:
+ branches: [deploy]
+
+env:
+ DEST: /home/public/1mb.club
+ SERVER: ssh.nyc1.nearlyfreespeech.net
+ BUNDLE_PATH: vendor/bundle
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: '3.3'
+ bundler-cache: true
+
+ - name: SSH setup
+ run: |
+ mkdir -p ~/.ssh
+ echo "${{ secrets.NFS_ACCESS }}" > ~/.ssh/id_ed25519
+ chmod 600 ~/.ssh/id_ed25519
+ ssh-keyscan -H -4 "$SERVER" >> ~/.ssh/known_hosts
+
+ - name: Build
+ run: bundle exec jekyll build
+
+ - name: Deploy
+ run: rsync -rltvz --delete -e "ssh -i ~/.ssh/id_ed25519" _site/ "${{ secrets.NFS_USER }}@$SERVER:$DEST/"