samuel-philipp.de/.forgejo/workflows/build-deploy.yml

88 lines
3 KiB
YAML
Raw Normal View History

2023-12-06 01:03:02 +00:00
name: Build and Deploy Website
2023-12-06 22:21:09 +00:00
on: [push]
2023-12-06 01:03:02 +00:00
jobs:
2024-04-01 16:02:49 +00:00
build-dev:
name: Build Dev Website
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 English Version
run: npm run build:dev
- name: Build German Version
run: npm run build:dev:de
- uses: actions/upload-artifact@v4
2024-04-01 16:02:49 +00:00
with:
name: build
path: dist/
2023-12-06 01:03:02 +00:00
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
2024-04-01 16:02:49 +00:00
if: github.ref == 'refs/heads/main'
2023-12-06 01:03:02 +00:00
steps:
2024-03-29 02:00:29 +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
- uses: actions/upload-artifact@v4
2023-12-06 01:21:39 +00:00
with:
2023-12-06 02:08:39 +00:00
name: build
2023-12-06 01:21:39 +00:00
path: dist/
2023-12-06 01:38:03 +00:00
deploy-dev:
2023-12-06 02:08:39 +00:00
name: Deploy Dev 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
2024-04-01 16:02:49 +00:00
needs: [build-dev]
2023-12-06 02:08:39 +00:00
if: github.ref == 'refs/heads/develop'
2023-12-06 01:38:03 +00:00
steps:
2024-03-29 17:26:26 +00:00
- 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
2024-04-09 23:15:25 +00:00
run: lftp -e "set ftp:ssl-force true; set ssl:verify-certificate no; mirror -R -e ./build/en/ dev.samuel-philipp.com/; bye" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_HOST
2023-12-06 02:04:40 +00:00
env:
2023-12-06 02:13:25 +00:00
FTP_HOST: ${{ secrets.FTP_HOST }}
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
2023-12-06 01:38:03 +00:00
- name: Deploy German Version
2024-04-09 23:15:25 +00:00
run: lftp -e "set ftp:ssl-force true; set ssl:verify-certificate no; mirror -R -e ./build/de/ dev.samuel-philipp.de/; bye" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_HOST
2023-12-06 02:08:39 +00:00
env:
2023-12-06 02:13:25 +00:00
FTP_HOST: ${{ secrets.FTP_HOST }}
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
2023-12-06 02:08:39 +00:00
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:26:26 +00:00
- uses: actions/download-artifact@v3
2023-12-06 02:08:39 +00:00
- name: Install Dependencies
run: which lftp || ( apk --update add lftp )
- name: Deploy English Version
2024-04-09 23:15:25 +00:00
run: lftp -e "set ftp:ssl-force true; set ssl:verify-certificate no; mirror -R -e ./build/en/ samuel-philipp.com/; bye" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_HOST
2023-12-06 02:08:39 +00:00
env:
2023-12-06 02:13:25 +00:00
FTP_HOST: ${{ secrets.FTP_HOST }}
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
2023-12-06 02:08:39 +00:00
- name: Deploy German Version
2024-04-09 23:15:25 +00:00
run: lftp -e "set ftp:ssl-force true; set ssl:verify-certificate no; mirror -R -e ./build/de/ samuel-philipp.de/; bye" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_HOST
2023-12-06 02:04:40 +00:00
env:
2023-12-06 02:13:25 +00:00
FTP_HOST: ${{ secrets.FTP_HOST }}
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}