Skip to content

Commit

Permalink
ajuste na action
Browse files Browse the repository at this point in the history
  • Loading branch information
enoqueleal committed Feb 22, 2025
1 parent 1a199bb commit 19cfa18
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 20 deletions.
86 changes: 68 additions & 18 deletions .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
@@ -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
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
6 changes: 4 additions & 2 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ theme = 'paper'
title = "Car Store"
languageCode = "pt"
DefaultContentLanguage = "pt"
paginate = 3
enableEmoji = true

disqusShortname = 'professor-enoqueleal-github-io'
Expand Down Expand Up @@ -33,4 +32,7 @@ disqusShortname = 'professor-enoqueleal-github-io'
identifier = "contact"
name = "YouTube"
url = "http://youtube.com/@enoque-dev"
weight = 10
weight = 10

[pagination]
pagerSize = 3

0 comments on commit 19cfa18

Please sign in to comment.