samuel-philipp.de/.forgejo/workflows/build-deploy.yml
Renovate Bot 5f6d5c9c22
Some checks failed
Build and Deploy Website / Build Dev Website (push) Failing after 50s
Build and Deploy Website / Build Website (push) Has been skipped
Build and Deploy Website / Deploy Dev Website (push) Has been skipped
Build and Deploy Website / Deploy Website (push) Has been skipped
Update actions/upload-artifact action to v4
2024-08-09 19:02:07 +00:00

87 lines
3 KiB
YAML

name: Build and Deploy Website
on: [push]
jobs:
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
with:
name: build
path: dist/
build:
name: Build 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
- name: Build German Version
run: npm run build:de
- uses: actions/upload-artifact@v4
with:
name: build
path: dist/
deploy-dev:
name: Deploy Dev Website
runs-on: docker
container:
image: node:lts-alpine
needs: [build-dev]
if: github.ref == 'refs/heads/develop'
steps:
- uses: actions/download-artifact@v3
- name: Install Dependencies
run: which lftp || ( apk --update add lftp )
- name: Deploy English Version
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
env:
FTP_HOST: ${{ secrets.FTP_HOST }}
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
- name: Deploy German Version
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
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:
- uses: actions/download-artifact@v3
- name: Install Dependencies
run: which lftp || ( apk --update add lftp )
- name: Deploy English Version
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
env:
FTP_HOST: ${{ secrets.FTP_HOST }}
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
- name: Deploy German Version
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
env:
FTP_HOST: ${{ secrets.FTP_HOST }}
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}