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