Skip to content

Commit d63d39d

Browse files
Add GitHub Actions workflow for automatic deployment on push to main
1 parent e74e517 commit d63d39d

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows /main.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
name: 🚀 Deploy website on push
7+
8+
jobs:
9+
web-deploy:
10+
name: 🎉 Deploy on The server
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: 🚚 Get latest code
14+
uses: actions/checkout@v4
15+
16+
- name: Install PHP and Composer
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '8.2'
20+
tools: 'composer'
21+
22+
- name: Composer install
23+
run: composer install --no-dev --optimize-autoloader
24+
25+
- name: NPM install
26+
run: npm install && npm run build
27+
28+
- name: 📂 Sync files
29+
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
30+
with:
31+
server: ${{ secrets.SERVER }}
32+
username: ${{ secrets.USERNAME }}
33+
password: ${{ secrets.PASSWORD }}
34+
protocol: ftp
35+
port: 21

0 commit comments

Comments
 (0)