summaryrefslogtreecommitdiff
path: root/.github/workflows/main.yml
blob: e25aa0504e80cbada85e907aac8f9bdd498f0a8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Deploy to Neocities

# Only run on changes to the main branch
on:
  push:
    branches:
      - main

concurrency: # Prevent concurrent deploys doing strange things
  group: deploy-to-neocities
  cancel-in-progress: true

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
    # Step 1: Check out the repository
    - uses: actions/checkout@v3

    # Step 2: Set up Hugo (this downloads and installs Hugo)
    - name: Setup Hugo
      uses: peaceiris/actions-hugo@v2
      with:
        hugo-version: 'latest' # You can specify a specific version if needed

    # Step 3: Build the Hugo site
    - name: Build the Hugo site
      run: hugo

    # Step 4: Deploy the 'public' folder to Neocities
    - name: Deploy to Neocities
      uses: bcomnes/deploy-to-neocities@v2
      with:
        api_token: ${{ secrets.NEOCITIES_API_TOKEN }} # Your Neocities API token stored as a secret
        cleanup: false
        dist_dir: public # The Hugo output folder