2023-12-06 01:03:02 +00:00
|
|
|
name: Build and Deploy Website
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- develop
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-12-06 01:12:52 +00:00
|
|
|
name: Build Website
|
2023-12-06 01:03:02 +00:00
|
|
|
runs-on: docker
|
|
|
|
container:
|
|
|
|
image: node:lts
|
|
|
|
steps:
|
2023-12-06 02:00:54 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-12-06 01:03:02 +00:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: npm install
|
|
|
|
- name: Build English Version
|
|
|
|
run: npm run build
|
|
|
|
- name: Build German Version
|
|
|
|
run: npm run build:de
|
2023-12-06 01:21:39 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-12-06 01:55:14 +00:00
|
|
|
name: website
|
2023-12-06 01:21:39 +00:00
|
|
|
path: dist/
|
2023-12-06 01:38:03 +00:00
|
|
|
deploy-dev:
|
2023-12-06 01:55:14 +00:00
|
|
|
needs: [website]
|
2023-12-06 01:38:03 +00:00
|
|
|
runs-on: docker
|
|
|
|
container:
|
2023-12-06 01:55:14 +00:00
|
|
|
image: node:lts-alpine
|
2023-12-06 01:38:03 +00:00
|
|
|
if:
|
|
|
|
- github.ref == 'refs/heads/develop'
|
|
|
|
steps:
|
|
|
|
- uses: actions/download-artifact@v3
|
2023-12-06 01:49:23 +00:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: which lftp || ( apk --update add lftp )
|
2023-12-06 01:38:03 +00:00
|
|
|
- name: Deploy English Version
|
2023-12-06 01:49:23 +00:00
|
|
|
run: lftp -e "set ftp:ssl-force true; set ssl:verify-certificate no; mirror -R ./dist/en/ dev.samuel-philipp.com/; bye" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_HOST
|
2023-12-06 01:38:03 +00:00
|
|
|
- name: Deploy German Version
|
2023-12-06 01:49:23 +00:00
|
|
|
run: lftp -e "set ftp:ssl-force true; set ssl:verify-certificate no; mirror -R ./dist/de/ dev.samuel-philipp.de/; bye" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_HOST
|