name: Build and deploy the poweronoff.click hugo on: push: branches: - master pull_request: # Serialise deploys per ref so two quick pushes cannot publish out of order. concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: false jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 with: submodules: recursive # The image runs as a non-root user, so the mounted workspace must be # writable. Keep HUGO_VERSION in sync with the Makefile. - name: Prepare workspace run: chmod -R a+rwX . - name: Build uses: docker://ghcr.io/gohugoio/hugo:v0.169.0 with: args: --minify - name: Deploy if: github.event_name == 'push' && github.ref == 'refs/heads/master' uses: appleboy/scp-action@v0.1.7 with: host: poweronoff.click username: ${{ secrets.SSH_USERNAME }} password: ${{ secrets.SSH_PASSWORD }} port: ${{ secrets.SSH_PORT }} source: "public/*" target: /var/www/poweronoff.click rm: false strip_components: 1 - name: Send Telegram notification if: always() && github.event_name == 'push' uses: appleboy/telegram-action@v0.1.1 with: to: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }} message: | ${{ github.repository }} — ${{ job.status }} Commit: ${{ github.event.head_commit.message }} ${{ github.event.head_commit.url }}