name: Build and Deploy

on:
  push:
    branches:
      - master

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7

    - name: Setup Node 20
      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.0.3
      with:
        node-version: 20

    - name: Build Vuepress Pages
      run: npm install && npm run build
      # env:
      #   VUEPRESS_BASE: '/ocelot.social/'

    - name: Deploy Vuepress to Github Pages
      uses: crazy-max/ghaction-github-pages@df5cc2bfa78282ded844b354faee141f06b41865 # v4.0.0
      with:
        target_branch: gh-pages
        build_dir: docs/.vuepress/dist
        author: Wolfgang Huß <vorstand@busfaktor.org>
        fqdn: ocelot.social
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
