From 19cfa18fcb1cfc77106cf3cee9f3c7df5f935dbb Mon Sep 17 00:00:00 2001 From: Enoque Leal Date: Sat, 22 Feb 2025 10:41:53 -0300 Subject: [PATCH] ajuste na action --- .github/workflows/hugo.yaml | 86 +++++++++++++++++++++++++++++-------- hugo.toml | 6 ++- 2 files changed, 72 insertions(+), 20 deletions(-) diff --git a/.github/workflows/hugo.yaml b/.github/workflows/hugo.yaml index 80c024f..5692b53 100644 --- a/.github/workflows/hugo.yaml +++ b/.github/workflows/hugo.yaml @@ -1,28 +1,78 @@ -name: Build and Deploy Hugo Site +name: Deploy Hugo site to Pages on: push: branches: - - main # ou a branch que vocĂȘ deseja usar + - main + workflow_dispatch: + +permissions: + contents: write + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +defaults: + run: + shell: bash jobs: build: runs-on: ubuntu-latest - + env: + HUGO_VERSION: 0.111.3 steps: - - name: Checkout repository - uses: actions/checkout@v2 + - name: Install Hugo CLI + run: | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ + && sudo dpkg -i ${{ runner.temp }}/hugo.deb + - name: Install Dart Sass Embedded + run: sudo snap install dart-sass-embedded + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + fetch-depth: 0 + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 + - name: Install Node.js dependencies + run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" + - name: Build with Hugo + env: + HUGO_ENVIRONMENT: production + HUGO_ENV: production + run: | + hugo \ + --gc \ + --minify \ + --baseURL "${{ steps.pages.outputs.base_url }}/" + - name: List files in public directory + run: ls -la public/ + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: pages-artifact + path: public/ + - name: Verify artifact upload + run: echo "Artifact 'pages-artifact' uploaded successfully." - - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 - with: - hugo-version: 'latest' - - - name: Build site - run: hugo --minify - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./public \ No newline at end of file + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: pages-artifact + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./public \ No newline at end of file diff --git a/hugo.toml b/hugo.toml index 4e46469..1d04385 100644 --- a/hugo.toml +++ b/hugo.toml @@ -2,7 +2,6 @@ theme = 'paper' title = "Car Store" languageCode = "pt" DefaultContentLanguage = "pt" -paginate = 3 enableEmoji = true disqusShortname = 'professor-enoqueleal-github-io' @@ -33,4 +32,7 @@ disqusShortname = 'professor-enoqueleal-github-io' identifier = "contact" name = "YouTube" url = "http://youtube.com/@enoque-dev" - weight = 10 \ No newline at end of file + weight = 10 + +[pagination] + pagerSize = 3 \ No newline at end of file