Update FAQ (#78) #49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Generate and deploy' | |
on: | |
push: | |
branches: [ production ] | |
jobs: | |
deploy-website: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install SSH Key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SERVER_SSH_KEY }} | |
known_hosts: unnecessary | |
- name: Adding Known Hosts | |
run: ssh-keyscan -H ${{ secrets.REMOTE_HOST }} >> ~/.ssh/known_hosts | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: 'latest' | |
extended: true | |
- name: Setup Node and Install | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install Dependencies | |
run: npm install && npm run mod:update | |
- name: Make Resources Folder Locally | |
run: mkdir resources | |
- name: Download resources from server | |
run: rsync -rlgoDzvc -i ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }}:/home/${{ secrets.REMOTE_USER }}/${{ secrets.HUGO_RESOURCES_URL }}/ resources/ | |
- name: Build Website | |
run: npm run build | |
- name: Delete Extra Folder | |
run: rm -rf public/404/ | |
- name: Push Website to Server | |
run: rsync -rlgoDzvc -i --delete public/ ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }}:/home/${{ secrets.REMOTE_USER }}/${{ secrets.REMOTE_HOST }}/ |