on: push: branches: - main env: SERVER_URL: ${{ vars.SERVER_URL }} jobs: build-website: name: Build and deploy website runs-on: alpine container: image: alpine:edge defaults: run: shell: ash -eo pipefail {0} steps: - name: Install dependencies run: apk add --no-cache curl nodejs git zola openssh minify - name: Checkout repository uses: actions/checkout@v4 - name: Build web run: zola build - name: Minify files run: minify --all -r -o . public - name: Output SSH key to file run: | echo "${{ secrets.SSH_KEY }}" > ssh_id chmod 0600 ssh_id - name: Transfer built files run: scp -i ssh_id -o StrictHostKeyChecking=accept-new -r ./public/. ${{ env.SERVER_URL }}