Skip to content

Commit

Permalink
Add basic Github Actions deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
yzoug committed Nov 24, 2024
1 parent 122e3bd commit 86aa5f9
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deployer
run-name: Build and deploy zoug.fr
on:
push:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
environment: deploy
steps:
- name: Checkout the current branch
uses: actions/checkout@v3

- name: Copy private key to runner
env:
PRIVKEY: ${{ secrets.CI_SSH_PRIVKEY }}
run: echo "$PRIVKEY" > ~/.ssh/id_ed25519

- name: Install Zola
run: sudo snap install zola --edge

- name: Build the website
run: zola build

- name: Scan the host key
env:
HOST: ${{ secrets.CI_SSH_HOSTNAME }}
run: ssh-keyscan $HOST > ~/.ssh/known_hosts

- name: Deploy the website
env:
USER: ${{ secrets.CI_SSH_USER }}
HOST: ${{ secrets.CI_SSH_HOSTNAME }}
run: rsync -avx -e "ssh -i ~/.ssh/id_ed25519" --delete --exclude '.ssh' public/ $USER@$HOST:./

0 comments on commit 86aa5f9

Please sign in to comment.