From bf02657481b9f1cddcb21f66ab2b877dbf345351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 24 Jan 2024 10:46:27 +0100 Subject: [PATCH 1/2] Setup gitea action to build the website, build docker image and push it on registry --- .gitea/workflows/build-image.yaml | 73 +++++++++++++++ .github/workflows/main.yml | 75 --------------- .idea/.gitignore | 8 -- .idea/{hugoplate.iml => chill_hugoplate.iml} | 0 .idea/codeStyles/Project.xml | 62 ++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/inspectionProfiles/Project_Default.xml | 6 ++ .idea/jsLinters/jshint.xml | 16 ++++ .idea/modules.xml | 2 +- .idea/workspace.xml | 99 ++++++++++++++++++++ Caddyfile | 3 - Dockerfile | 4 +- go.mod | 45 +++++---- 13 files changed, 285 insertions(+), 113 deletions(-) create mode 100644 .gitea/workflows/build-image.yaml delete mode 100644 .github/workflows/main.yml delete mode 100644 .idea/.gitignore rename .idea/{hugoplate.iml => chill_hugoplate.iml} (100%) create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/jsLinters/jshint.xml create mode 100644 .idea/workspace.xml delete mode 100644 Caddyfile diff --git a/.gitea/workflows/build-image.yaml b/.gitea/workflows/build-image.yaml new file mode 100644 index 0000000..232813e --- /dev/null +++ b/.gitea/workflows/build-image.yaml @@ -0,0 +1,73 @@ +name: Build an image to deploy website + +on: + # Runs on pushes targeting the default branch + push: + tags: + - v* + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Environment variables available to all jobs and steps in this workflow +env: + HUGO_ENV: production + HUGO_VERSION: "0.121.2" + GO_VERSION: "1.21.4" + NODE_VERSION: "18" + +jobs: + # Build job + build: + runs-on: cth-ubuntu-latest + steps: + - name: Check out repository + uses: https://github.com/actions/checkout@v4 + + - name: Setup node + uses: https://github.com/actions/setup-node@v4 + with: + node-version: '${{ NODE_VERSION }}' + + - name: Setup Hugo + uses: https://github.com/peaceiris/actions-hugo@v2 + with: + hugo-version: '${{ HUGO_VERSION }}' + extended: true + + - name: Setup Go + uses: https://github.com/actions/setup-go@v5 + with: + go-version: '1.21.4' + + - name: Setup Project + run: npm run project-setup + + - name: Install npm dependencies + run: npm install + + - name: Compile website + run: npm run build + + - name: Set up Docker Buildx + uses: https://github.com/docker/setup-buildx-action@v3 + + - name: Login to registry + uses: https://github.com/docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + registry: 'h3m6q87t.gra7.container-registry.ovh.net' + + - name: debug + run: ls -lah + + - name: Build and push + uses: https://github.com/docker/build-push-action@v5 + with: + context: . + push: true + tags: 'h3m6q87t.gra7.container-registry.ovh.net/chill_website/web:${{ github.ref_name }}' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index c10c7fe..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,75 +0,0 @@ -# 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"] - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Environment variables available to all jobs and steps in this workflow -env: - HUGO_ENV: production - HUGO_VERSION: "0.118.2" - GO_VERSION: "1.20.5" - NODE_VERSION: "18.15.0" - TINA_CLIENT_ID: ${{ vars.TINA_CLIENT_ID }} - TINA_TOKEN: ${{ vars.TINA_TOKEN }} - -jobs: - # Build job - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Install Hugo - run: | - curl -LO "https://github.com/gohugoio/hugo/releases/download/v${{ env.HUGO_VERSION }}/hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz" - tar -xvf hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz - sudo mv hugo /usr/local/bin/ - rm hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz - hugo version - - - name: Install Go - run: | - curl -LO "https://dl.google.com/go/go${{ env.GO_VERSION }}.linux-amd64.tar.gz" - sudo tar -C /usr/local -xzf go${{ env.GO_VERSION }}.linux-amd64.tar.gz - echo "export PATH=$PATH:/usr/local/go/bin" >> $GITHUB_ENV - rm go${{ env.GO_VERSION }}.linux-amd64.tar.gz - go version - - - name: Setup Project - run: npm run project-setup - - - name: Install npm dependencies - run: npm install - - - name: Publish to GitHub Pages - run: npm run build - - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - 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@v2 diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/hugoplate.iml b/.idea/chill_hugoplate.iml similarity index 100% rename from .idea/hugoplate.iml rename to .idea/chill_hugoplate.iml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..c1bbb47 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..eff7139 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/jsLinters/jshint.xml b/.idea/jsLinters/jshint.xml new file mode 100644 index 0000000..194fe81 --- /dev/null +++ b/.idea/jsLinters/jshint.xml @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index 323f7bc..8b5c9d1 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..a50a9ca --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1706086985231 + + + + + + + + + + + + \ No newline at end of file diff --git a/Caddyfile b/Caddyfile deleted file mode 100644 index b6249b5..0000000 --- a/Caddyfile +++ /dev/null @@ -1,3 +0,0 @@ -chill.social { - root /public -} diff --git a/Dockerfile b/Dockerfile index 0d945fd..c4c3953 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,3 @@ -FROM klakegg/hugo:alpine-onbuild AS hugo - FROM caddy:2-alpine -ADD src/ /usr/share/caddy/ +ADD public/ /usr/share/caddy/ diff --git a/go.mod b/go.mod index 5d1f93b..4db21c3 100644 --- a/go.mod +++ b/go.mod @@ -3,27 +3,26 @@ module hugoplate.netlify.app go 1.20 require ( - github.com/gethugothemes/hugo-modules/accordion v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/adsense v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/components/cookie-consent v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/components/custom-script v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/components/preloader v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/components/render-link v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/components/social-share v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/gallery-slider v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/gzip-caching v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/icons/font-awesome v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/images v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/modal v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/pwa v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/search v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/seo-tools/basic-seo v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/seo-tools/google-tag-manager v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/seo-tools/site-verifications v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/shortcodes/button v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/shortcodes/notice v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/tab v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/table-of-contents v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/gethugothemes/hugo-modules/videos v0.0.0-20231001043352-2e720c5b7e8b // indirect - github.com/zeon-studio/hugoplate v0.0.0-20230919033707-39e487943d6d // indirect + github.com/gethugothemes/hugo-modules/accordion v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/adsense v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/components/cookie-consent v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/components/custom-script v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/components/preloader v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/components/render-link v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/components/social-share v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/gallery-slider v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/gzip-caching v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/icons/font-awesome v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/images v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/modal v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/pwa v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/search v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/seo-tools/basic-seo v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/seo-tools/google-tag-manager v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/seo-tools/site-verifications v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/shortcodes/button v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/shortcodes/notice v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/tab v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/table-of-contents v0.0.0-20231213094845-42e6b5af6245 // indirect + github.com/gethugothemes/hugo-modules/videos v0.0.0-20231213094845-42e6b5af6245 // indirect ) -- 2.45.2 From 022dd5b48bf49f5d1baaf3538e75a1f7859416fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 24 Jan 2024 14:28:08 +0100 Subject: [PATCH 2/2] Add changie --- .changes/1.0.0.md | 3 +++ .changes/header.tpl.md | 6 ++++++ .changes/unreleased/.gitkeep | 0 .changie.yaml | 26 ++++++++++++++++++++++++++ .gitignore | 3 ++- CHANGELOG.md | 11 +++++++++++ 6 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .changes/1.0.0.md create mode 100644 .changes/header.tpl.md create mode 100644 .changes/unreleased/.gitkeep create mode 100644 .changie.yaml create mode 100644 CHANGELOG.md diff --git a/.changes/1.0.0.md b/.changes/1.0.0.md new file mode 100644 index 0000000..815d0d5 --- /dev/null +++ b/.changes/1.0.0.md @@ -0,0 +1,3 @@ +## 1.0.0 - 2024-01-24 +### Added +* Started brand new website diff --git a/.changes/header.tpl.md b/.changes/header.tpl.md new file mode 100644 index 0000000..df8faa7 --- /dev/null +++ b/.changes/header.tpl.md @@ -0,0 +1,6 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), +and is generated by [Changie](https://github.com/miniscruff/changie). diff --git a/.changes/unreleased/.gitkeep b/.changes/unreleased/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.changie.yaml b/.changie.yaml new file mode 100644 index 0000000..906d495 --- /dev/null +++ b/.changie.yaml @@ -0,0 +1,26 @@ +changesDir: .changes +unreleasedDir: unreleased +headerPath: header.tpl.md +changelogPath: CHANGELOG.md +versionExt: md +versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}' +kindFormat: '### {{.Kind}}' +changeFormat: '* {{.Body}}' +kinds: +- label: Added + auto: minor +- label: Changed + auto: major +- label: Deprecated + auto: minor +- label: Removed + auto: major +- label: Fixed + auto: patch +- label: Security + auto: patch +newlines: + afterChangelogHeader: 1 + beforeChangelogVersion: 1 + endOfVersion: 1 +envPrefix: CHANGIE_ diff --git a/.gitignore b/.gitignore index 0c14a96..8125eaf 100755 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ resources jsconfig.json hugo_stats.json go.sum -yarn.lock \ No newline at end of file +yarn.lock +.idea/* diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1b13252 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), +and is generated by [Changie](https://github.com/miniscruff/changie). + + +## 1.0.0 - 2024-01-24 +### Added +* Started brand new website -- 2.45.2