r/c/s cannot into correct fields #39
This file contains hidden or 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: Build and deploy Zola Site | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Grab source | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'true' | |
| - name: Install Zola | |
| run: sudo snap install --edge zola | |
| - name: Build with Zola | |
| run: zola build | |
| - name: Verify build output | |
| run: | | |
| # Check if the build output directory exists | |
| if [ ! -d "public" ]; then | |
| echo "Zola build failed: 'public' directory not found." | |
| exit 1 | |
| fi | |
| echo "Zola build succeeded!" | |
| - name: Install SSH keys | |
| uses: shimataro/ssh-key-action@v2 | |
| with: | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
| - name: Deploy to server | |
| run: | | |
| rsync -avz -e "ssh -J ${{ secrets.USER }}@${{ secrets.HOST }}" \ | |
| --delete public/ \ | |
| ${{ secrets.USER }}@${{ secrets.HOST2 }}:/var/www/html/ |