2023-12-06 22:56:13 +00:00
|
|
|
name: Build and Deploy Website
|
|
|
|
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build Website
|
|
|
|
runs-on: docker
|
|
|
|
container:
|
|
|
|
image: node:lts
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: npm install
|
|
|
|
- name: Build Website
|
|
|
|
run: npm run build
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: build
|
|
|
|
path: dist/
|
|
|
|
deploy-dev:
|
|
|
|
name: Deploy Dev Website
|
|
|
|
runs-on: docker
|
|
|
|
container:
|
|
|
|
image: node:lts-alpine
|
|
|
|
needs: [build]
|
|
|
|
if: github.ref == 'refs/heads/develop'
|
|
|
|
steps:
|
2024-01-14 01:01:10 +00:00
|
|
|
- uses: actions/download-artifact@v4
|
2023-12-06 22:56:13 +00:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: which lftp || ( apk --update add lftp )
|
|
|
|
- name: Deploy Website
|
|
|
|
run: lftp -e "set ftp:ssl-force true; set ssl:verify-certificate no; mirror -R ./build/ dev.sp-magic.de/; bye" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_HOST
|
|
|
|
env:
|
|
|
|
FTP_HOST: ${{ secrets.FTP_HOST }}
|
|
|
|
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
|
|
|
|
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
|
|
|
|
deploy:
|
|
|
|
name: Deploy Website
|
|
|
|
runs-on: docker
|
|
|
|
container:
|
|
|
|
image: node:lts-alpine
|
|
|
|
needs: [build]
|
|
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
steps:
|
2024-01-14 01:01:10 +00:00
|
|
|
- uses: actions/download-artifact@v4
|
2023-12-06 22:56:13 +00:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: which lftp || ( apk --update add lftp )
|
|
|
|
- name: Deploy Website
|
|
|
|
run: lftp -e "set ftp:ssl-force true; set ssl:verify-certificate no; mirror -R ./build/ sp-magic.de/; bye" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_HOST
|
|
|
|
env:
|
|
|
|
FTP_HOST: ${{ secrets.FTP_HOST }}
|
|
|
|
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
|
|
|
|
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
|