From b302ecb5f8a7cfd3dafdf760ebdee507b6300ed2 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sat, 27 Apr 2024 16:50:17 +0700 Subject: [PATCH] [Change] to GitHub Pages --- .github/workflows/publish.yaml | 78 +++++++++++++++++++++++++++ README.md | 2 +- config.yml | 2 +- old-config.toml | 98 ---------------------------------- 4 files changed, 80 insertions(+), 100 deletions(-) create mode 100644 .github/workflows/publish.yaml delete mode 100644 old-config.toml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..1a83f16 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,78 @@ +# Sample workflow for building and deploying a Hugo site to GitHub Pages +name: Deploy Hugo site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: + - main + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +# Default to bash +defaults: + run: + shell: bash + +jobs: + # Build job + build: + runs-on: ubuntu-latest + env: + HUGO_VERSION: 0.124.0 + steps: + - 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 + run: sudo snap install dart-sass + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + - name: Setup Pages + id: pages + uses: actions/configure-pages@v4 + - name: Install Node.js dependencies + run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" + - name: Build with Hugo + env: + # For maximum backward compatibility with Hugo modules + HUGO_ENVIRONMENT: production + HUGO_ENV: production + run: | + hugo \ + --gc \ + --minify \ + --baseURL "${{ steps.pages.outputs.base_url }}/" + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./public + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index 30a6ad1..5c67a63 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # MiTi99 -Source code of my blog at [https://miti99.dev](). \ No newline at end of file +Source code of my blog. \ No newline at end of file diff --git a/config.yml b/config.yml index f0fcc40..f0e37a5 100644 --- a/config.yml +++ b/config.yml @@ -2,7 +2,7 @@ module: imports: - path: github.com/adityatelange/hugo-PaperMod -baseURL: "https://miti99.dev" +baseURL: "https://tiennm99.github.io" title: miti99 paginate: 5 diff --git a/old-config.toml b/old-config.toml deleted file mode 100644 index c5384f5..0000000 --- a/old-config.toml +++ /dev/null @@ -1,98 +0,0 @@ -baseURL = "https://miti99.dev" -title = "miti99" -#theme = "hugo-coder" -languageCode = "en" -defaultContentLanguage = "en" -paginate = 20 -pygmentsStyle = "bw" -pygmentsCodeFences = true -pygmentsCodeFencesGuessSyntax = true -enableEmoji = true - -googleAnalytics = 183798571 -[params.googleTagManager] -id = "GTM-WR9BX9K" -[params.applicationInsights] -connectionString = "InstrumentationKey=995c7eeb-e39f-4dbf-9d36-222d09fd97d8;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/" - -[params] -author = "MiTi99" -info = ["Developer", "Wibu"] -description = "MiTi99's personal website" -keywords = "miti99,blog,developer,personal" -avatarURL = "img/avatar.jpg" -favicon_32 = "img/favicon.png" -#favicon_16 = "img/favicon_16.png" -touchIcon = "img/touchIcon.png" -dateFormat = "January 2, 2006" -since = 2020 -maxSeeAlsoItems = 6 -commit = "https://github.com/tiennm99/miti99/tree/" -rtl = false -math = true -katex = true -colorScheme = "auto" -hideColorSchemeToggle = false -customCSS = [] -customSCSS = [] -customJS = [] -enableTwemoji = true - -[params.utterances] -repo = "tiennm99/miti99" -issueTerm = "pathname" -label = "" -theme = "preferred-color-scheme" - -[taxonomies] -category = "categories" -series = "series" -tag = "tags" -author = "authors" - -[[params.social]] -name = "Github" -icon = "fa fa-2x fa-github" -url = "https://github.com/tiennm99/" - -[[params.social]] -name = "Gitlab" -icon = "fa fa-2x fa-gitlab" -url = "https://gitlab.com/miti99/" - -[[params.social]] -name = "Facebook" -icon = "fa fa-2x fa-facebook" -url = "https://facebook.com/miti99" - -[[params.social]] -name = "RSS" -icon = "fa fa-2x fa-rss" -url = "index.xml" -rel = "alternate" -type = "application/rss+xml" - -[[menu.main]] -name = "About" -weight = 2 -url = "about/" - -[[menu.main]] -name = "Contact" -weight = 3 -url = "contact/" - -[[menu.main]] -name = "CV" -weight = 4 -url = "https://tiennm99.github.io" - -[[menu.main]] -name = "Misc" -weight = 5 -url = "misc/" - -[[menu.main]] -name = "Posts" -weight = 1 -url = "posts/"