Skip to content

Commit c176def

Browse files
committed
feat: Add CI/CD workflow for automatic deployment
1 parent fff74d6 commit c176def

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and Deploy to Hostinger
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm install
24+
25+
- name: Build Eleventy site
26+
run: npx @11ty/eleventy
27+
28+
- name: Deploy to Hostinger
29+
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
30+
with:
31+
server: ${{ secrets.FTP_SERVER }}
32+
username: ${{ secrets.FTP_USERNAME }}
33+
password: ${{ secrets.FTP_PASSWORD }}
34+
protocol: sftp
35+
port: 22
36+
local-dir: ./_site/
37+
remote-dir: ${{ secrets.REMOTE_PATH }}
38+
cleanup: true

0 commit comments

Comments
 (0)