Skip to content
This repository was archived by the owner on Nov 16, 2024. It is now read-only.

Create a GitHub Actions Workflow #1

Open
JorgeSquared opened this issue Dec 12, 2023 · 0 comments
Open

Create a GitHub Actions Workflow #1

JorgeSquared opened this issue Dec 12, 2023 · 0 comments
Assignees

Comments

@JorgeSquared
Copy link
Contributor

To add ease to the workflow and enable best practices, we should set up continuous deployment:

name: Build and Deploy
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: 'latest'
          extended: true
      - name: Build
        run: hugo --minify
      - name: Deploy to gh-pages
        if: github.ref == 'refs/heads/main'  # This ensures deployment only occurs for pushes to main
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./public
@JorgeSquared JorgeSquared self-assigned this Dec 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant