Skip to content

Commit 094e0b7

Browse files
committed
Add basic Github Actions deployment
1 parent 122e3bd commit 094e0b7

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deployer
2+
run-name: Build and deploy zoug.fr
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
environment: deploy
11+
steps:
12+
- name: Checkout the current branch
13+
uses: actions/checkout@v4
14+
15+
- name: Initialize the ssh-agent
16+
uses: webfactory/[email protected]
17+
with:
18+
ssh-private-key: ${{ secrets.CI_SSH_PRIVKEY }}
19+
20+
- name: Install Zola
21+
run: sudo snap install zola --edge
22+
23+
- name: Build the website
24+
run: zola build
25+
26+
- name: Scan the host key
27+
run: ssh-keyscan ${{ CI_SSH_HOSTNAME }} >> ~/.ssh/known_hosts
28+
env:
29+
CI_SSH_HOSTNAME: ${{ secrets.CI_SSH_HOSTNAME }}
30+
31+
- name: Deploy the website
32+
run: >-
33+
rsync -avx --delete --exclude '.ssh' public/ ${{ CI_SSH_USER }}@${{ CI_SSH_HOSTNAME }}:./
34+
env:
35+
CI_SSH_HOSTNAME: ${{ secrets.CI_SSH_HOSTNAME }}
36+
CI_SSH_USER: ${{ secrets.CI_SSH_USER }}

0 commit comments

Comments
 (0)