diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 56b6088..3b35a59 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,26 +4,34 @@ on: push: branches: - main - + - dev + jobs: build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 with: - persist-credentials: false + hugo-version: 'latest' + extended: true - name: Build - run: | - yarn install - yarn build + run: hugo --minify env: - CI: false + HUGO_ENV: production - name: Deploy - uses: JamesIves/github-pages-deploy-action@releases/v4 + uses: JamesIves/github-pages-deploy-action@v4 with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: gh-pages - FOLDER: build + token: ${{ secrets.GITHUB_TOKEN }} + branch: gh-pages + folder: public + target-folder: ${{ github.ref_name == 'main' ? '' : 'v2' }} + clean: true