Build and deploy zoug.fr #5
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: Deployer | |
run-name: Build and deploy zoug.fr | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: deploy | |
steps: | |
- name: Checkout the current branch | |
uses: actions/checkout@v3 | |
- name: Initialize the ssh-agent | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.CI_SSH_PRIVKEY }} | |
- name: Install Zola | |
run: sudo snap install zola --edge | |
- name: Build the website | |
run: zola build | |
- name: Scan the host key | |
run: ssh-keyscan ${{ secrets.CI_SSH_HOSTNAME }} >> ~/.ssh/known_hosts | |
- name: Deploy the website | |
run: >- | |
rsync -avx --delete --exclude '.ssh' public/ ${{ secrets.CI_SSH_USER }}@${{ secrets.CI_SSH_HOSTNAME }}:./ |