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 094e0b7
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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@v4

- name: Initialize the ssh-agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.CI_SSH_PRIVKEY }}

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

- name: Build the website
run: zola build

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

- name: Deploy the website
run: >-
rsync -avx --delete --exclude '.ssh' public/ ${{ CI_SSH_USER }}@${{ CI_SSH_HOSTNAME }}:./
env:
CI_SSH_HOSTNAME: ${{ secrets.CI_SSH_HOSTNAME }}
CI_SSH_USER: ${{ secrets.CI_SSH_USER }}

0 comments on commit 094e0b7

Please sign in to comment.