From e9d50af0ae8a4f8b530715142d78dcb455420359 Mon Sep 17 00:00:00 2001 From: aleidk Date: Wed, 4 Dec 2024 19:24:58 -0300 Subject: [PATCH 1/9] chore: update project config files --- .forgejo/issue_template/01-content-update.yml | 42 +++++++++ .forgejo/issue_template/02-feature.yml | 60 ++++++++++++ .forgejo/issue_template/03-bug-report.yml | 93 +++++++++++++++++++ cog.toml | 5 +- 4 files changed, 198 insertions(+), 2 deletions(-) create mode 100644 .forgejo/issue_template/01-content-update.yml create mode 100644 .forgejo/issue_template/02-feature.yml create mode 100644 .forgejo/issue_template/03-bug-report.yml diff --git a/.forgejo/issue_template/01-content-update.yml b/.forgejo/issue_template/01-content-update.yml new file mode 100644 index 0000000..c755c70 --- /dev/null +++ b/.forgejo/issue_template/01-content-update.yml @@ -0,0 +1,42 @@ +name: Content update +about: Content creation or edition +title: '[Content]: ' +ref: 'content-update' +assignees: + - aleidk +labels: + - Priority/Low + - Severity/Low + - Status/Pending + - Type/Content +body: + - type: dropdown + id: topic + attributes: + label: "Topic:" + multiple: true + default: 0 + options: + - Garden + - Blog + - Devlog + - Other + validations: + required: true + + - type: textarea + id: content + attributes: + label: "Content description:" + description: Brief ideas of what this content is about. + placeholder: Lorem Ipsum... + validations: + required: true + + - type: textarea + id: extra + attributes: + label: "Extra data and references:" + placeholder: Lorem Ipsum... + validations: + required: false diff --git a/.forgejo/issue_template/02-feature.yml b/.forgejo/issue_template/02-feature.yml new file mode 100644 index 0000000..83eb99c --- /dev/null +++ b/.forgejo/issue_template/02-feature.yml @@ -0,0 +1,60 @@ +name: Feature request +about: Request a new feature to be added +title: '[Feature]: ' +ref: 'development' +assignees: + - aleidk +labels: + - Priority/Low + - Severity/Low + - Status/Pending + - Type/Feature +body: + - type: markdown + attributes: + value: | + We appreciate your feedback on how to improve this project. Please be sure to include as much details and any resources if possible! + + - type: dropdown + attributes: + multiple: false + label: Type of Feature + default: 0 + options: + - "✨ New Feature" + - "📝 Documentation" + - "🎨 Style and UI" + - "🔨 Code Refactor" + - "⚡ Performance Improvements" + - "✅ New Test" + - "🪢 Architecture" + validations: + required: true + + - type: textarea + id: description + attributes: + label: Description + description: Give us a brief description of the feature or enhancement you would like. + placeholder: As , I want because + validations: + required: true + + - type: textarea + id: completion-criteria + attributes: + label: Completion criteria + description: Tell us what this feature needs to do to be considered completed using verificable items. + placeholder: | + - [ ] Read the configuration file using the yaml format + - [ ] Fetch data from an the json-placehoder API + - [ ] Save the data in the database + validations: + required: true + + - type: textarea + id: additional-information + attributes: + label: Additional Information + description: | + Please leave any additional information on the feature request that could be helpful! like proposed solutions, examples, links, screenshots, etc. diff --git a/.forgejo/issue_template/03-bug-report.yml b/.forgejo/issue_template/03-bug-report.yml new file mode 100644 index 0000000..0662b0b --- /dev/null +++ b/.forgejo/issue_template/03-bug-report.yml @@ -0,0 +1,93 @@ +name: Bug report +about: Something isn't working as expected +title: '[Bug]: ' +ref: 'development' +assignees: + - aleidk +labels: + - Priority/Low + - Severity/Low + - Status/Pending + - Type/Bug +body: + - type: markdown + attributes: + value: | + We appreciate your feedback on how to improve this project. Please be sure to include as much details and any resources if possible! + + - type: checkboxes + id: terms + attributes: + label: Before submitting, I checked... + options: + - label: The [issue tracker](../) in case this has been reported before + required: true + - label: The severity of the bug + required: true + validations: + required: true + + - type: textarea + id: expected + attributes: + label: "Expected behavior:" + description: A clear and concise description of what you expected to happen. Include screenshots and/or logs if relevant. + placeholder: As , I want because + validations: + required: true + + - type: textarea + id: current + attributes: + label: "Current behavior:" + description: A clear and concise description of what actually happened. Include screenshots and/or logs if relevant. + placeholder: As , I want because + validations: + required: true + + - type: textarea + id: reproduce + attributes: + label: "Steps to reproduce:" + description: Anambiguous set of steps to reproduce this bug. Include code snippets if relevant. + placeholder: | + 1. Use x argument / navigate to + 2. Fill this information + 3. Go to... + 4. See error + validations: + required: true + + - type: dropdown + attributes: + multiple: false + label: Is this a regresion? + description: Did this behaviour used to work in the previous version? + default: 0 + options: + - "I don't know" + - "This is a new feature" + - "Yes" + - "No" + validations: + required: true + + - type: textarea + id: environment + attributes: + label: "Your environment:" + description: Tell us details about the environment you experienced the bug in. A minimal/isolated enviroment to reproduce would be apreciated. + placeholder: | + - Version used: + - Browser Name and version: + - Operating System and version (desktop or mobile): + - Link to your project: + validations: + required: false + + - type: textarea + id: additional-information + attributes: + label: "Additional Information:" + description: | + Please leave any additional information on the bug that could be helpful! like proposed solutions, examples, links, screenshots, etc. diff --git a/cog.toml b/cog.toml index e8317ed..2210454 100644 --- a/cog.toml +++ b/cog.toml @@ -1,9 +1,9 @@ from_latest_tag = true -ignore_merge_commits = false +ignore_merge_commits = true disable_changelog = false disable_bump_commit = false generate_mono_repository_global_tag = true -branch_whitelist = [] +branch_whitelist = ["main", "release/**"] skip_ci = "[skip ci]" skip_untracked = false pre_bump_hooks = [] @@ -14,6 +14,7 @@ post_package_bump_hooks = [] [git_hooks] [commit_types] +content = { changelog_title = "Content"} [changelog] path = "CHANGELOG.md" From 2059de21dabd6ad1fc165c7a9f8262699c14b367 Mon Sep 17 00:00:00 2001 From: aleidk Date: Thu, 5 Dec 2024 18:50:31 -0300 Subject: [PATCH 2/9] chore: add build actions --- .forgejo/workflows/build-docker-image.yaml | 27 ++++++++++++++++++++++ Dockerfile | 9 ++++++++ 2 files changed, 36 insertions(+) create mode 100644 .forgejo/workflows/build-docker-image.yaml create mode 100644 Dockerfile diff --git a/.forgejo/workflows/build-docker-image.yaml b/.forgejo/workflows/build-docker-image.yaml new file mode 100644 index 0000000..ee1c684 --- /dev/null +++ b/.forgejo/workflows/build-docker-image.yaml @@ -0,0 +1,27 @@ +name: Publish image +on: + push: + workflow_dispatch: + +jobs: + create-docker-images: + runs-on: host + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + registry: git.alecodes.page + username: ${{ vars.CONTAINER_REGISTRY_USER }} + password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: | + git.alecodes.page/alecodes/page:latest + git.alecodes.page/alecodes/page:${{ github.sha }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f69dae2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM --platform=linux/amd64 ghcr.io/getzola/zola:v0.19.2 AS builder + +COPY . /project +WORKDIR /project +RUN ["zola", "build"] + +FROM ghcr.io/static-web-server/static-web-server:2 +WORKDIR / +COPY --from=builder /project/dist /public From f3d7ff5d71135ff19c800af350cec341de5103f5 Mon Sep 17 00:00:00 2001 From: aleidk Date: Fri, 6 Dec 2024 20:33:04 -0300 Subject: [PATCH 3/9] build: add docker-stack.yml configuration --- docker-stack.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 docker-stack.yaml diff --git a/docker-stack.yaml b/docker-stack.yaml new file mode 100644 index 0000000..2f80b38 --- /dev/null +++ b/docker-stack.yaml @@ -0,0 +1,15 @@ +networks: + reverse-proxy: + external: true + +services: + page: + image: git.alecodes.page/alecodes/page:latest + restart: unless-stopped + networks: + - reverse-proxy + deploy: + labels: + - traefik.enable=true + - traefik.http.routers.personal-page.rule=Host(`alecodes.page`) + - traefik.http.services.personal-page.loadbalancer.server.port=80 From 893b80d262708acbe759b92c9ff92b6faa890c96 Mon Sep 17 00:00:00 2001 From: aleidk Date: Mon, 9 Dec 2024 10:49:01 -0300 Subject: [PATCH 4/9] build: add autodeploy workflow --- .forgejo/workflows/build-docker-image.yaml | 19 +++++++++++++++++++ content/_index.md | 2 +- docker-stack.yaml | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build-docker-image.yaml b/.forgejo/workflows/build-docker-image.yaml index ee1c684..52e6541 100644 --- a/.forgejo/workflows/build-docker-image.yaml +++ b/.forgejo/workflows/build-docker-image.yaml @@ -1,6 +1,8 @@ name: Publish image on: push: + branches: + - main workflow_dispatch: jobs: @@ -25,3 +27,20 @@ jobs: tags: | git.alecodes.page/alecodes/page:latest git.alecodes.page/alecodes/page:${{ github.sha }} + + deploy: + runs-on: ubuntu-latest + needs: + - create-docker-images + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: 'Docker Stack Deploy' + uses: https://github.com/cssnr/stack-deploy-action@v1 + with: + host: ${{ vars.DOCKER_SWARM_HOST }} + port: ${{ vars.DOCKER_SWARM_PORT }} + user: ${{ secrets.DOCKER_SWARM_USER }} + ssh_key: '${{ secrets.DOCKER_SWARM_SSH_KEY }}' + file: 'docker-stack.yaml' + name: 'personal-page' diff --git a/content/_index.md b/content/_index.md index 488c699..2f11bb4 100644 --- a/content/_index.md +++ b/content/_index.md @@ -2,4 +2,4 @@ +++ -# This is a awesome page :D +# This is a **really** awesome page :D diff --git a/docker-stack.yaml b/docker-stack.yaml index 2f80b38..55782e5 100644 --- a/docker-stack.yaml +++ b/docker-stack.yaml @@ -4,7 +4,7 @@ networks: services: page: - image: git.alecodes.page/alecodes/page:latest + image: git.alecodes.page/alecodes/page:${GITHUB_SHA:-latest} restart: unless-stopped networks: - reverse-proxy From b4bc5c016f20f9fe3cf9c0c7682cbd4c5e23d8cf Mon Sep 17 00:00:00 2001 From: aleidk Date: Mon, 9 Dec 2024 13:58:26 -0300 Subject: [PATCH 5/9] build: update content-update branch on push to main --- .forgejo/workflows/build-docker-image.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.forgejo/workflows/build-docker-image.yaml b/.forgejo/workflows/build-docker-image.yaml index 52e6541..8633f14 100644 --- a/.forgejo/workflows/build-docker-image.yaml +++ b/.forgejo/workflows/build-docker-image.yaml @@ -44,3 +44,22 @@ jobs: ssh_key: '${{ secrets.DOCKER_SWARM_SSH_KEY }}' file: 'docker-stack.yaml' name: 'personal-page' + + rebase: + runs-on: ubuntu-latest + needs: deploy + if: success() + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: '0' + ref: content-update + + - name: Update branch + run: | + set -x + git config --global user.name "robo" + git config --global user.email "robo@alecodes.page" + git rebase origin/main + git push origin content-update --force-with-lease From 9b0623261ba79672213431318df7a82f5ed0cf34 Mon Sep 17 00:00:00 2001 From: aleidk Date: Mon, 9 Dec 2024 15:37:52 -0300 Subject: [PATCH 6/9] ci: dummy commit for testing ci --- content/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/_index.md b/content/_index.md index 2f11bb4..64f3ea5 100644 --- a/content/_index.md +++ b/content/_index.md @@ -2,4 +2,4 @@ +++ -# This is a **really** awesome page :D +# This is a **really** awesome page :3 From 75595bba0e6aa1335cf54e2013e5bda79da77f0a Mon Sep 17 00:00:00 2001 From: aleidk Date: Tue, 10 Dec 2024 19:09:49 -0300 Subject: [PATCH 7/9] build: update stack config --- docker-stack.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docker-stack.yaml b/docker-stack.yaml index 55782e5..5a0d209 100644 --- a/docker-stack.yaml +++ b/docker-stack.yaml @@ -9,6 +9,15 @@ services: networks: - reverse-proxy deploy: + rollback_config: + failure_action: continue + update_config: + delay: 2s + failure_action: rollback + order: start-first + placement: + constraints: + - node.labels.services_kind==projects labels: - traefik.enable=true - traefik.http.routers.personal-page.rule=Host(`alecodes.page`) From 577974677ad945953e784f6d7855b4bc5c7b6a4d Mon Sep 17 00:00:00 2001 From: aleidk Date: Thu, 12 Dec 2024 16:26:00 -0300 Subject: [PATCH 8/9] build: update stack config --- docker-stack.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docker-stack.yaml b/docker-stack.yaml index 5a0d209..c49a3fe 100644 --- a/docker-stack.yaml +++ b/docker-stack.yaml @@ -1,13 +1,7 @@ -networks: - reverse-proxy: - external: true - services: page: image: git.alecodes.page/alecodes/page:${GITHUB_SHA:-latest} restart: unless-stopped - networks: - - reverse-proxy deploy: rollback_config: failure_action: continue From 8498bfca495a91c2333e60bd58fb300f7428703f Mon Sep 17 00:00:00 2001 From: aleidk Date: Fri, 13 Dec 2024 11:04:27 -0300 Subject: [PATCH 9/9] build: update stack config --- .forgejo/workflows/build-docker-image.yaml | 2 +- docker-stack.yaml | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/build-docker-image.yaml b/.forgejo/workflows/build-docker-image.yaml index 8633f14..101f9c9 100644 --- a/.forgejo/workflows/build-docker-image.yaml +++ b/.forgejo/workflows/build-docker-image.yaml @@ -43,7 +43,7 @@ jobs: user: ${{ secrets.DOCKER_SWARM_USER }} ssh_key: '${{ secrets.DOCKER_SWARM_SSH_KEY }}' file: 'docker-stack.yaml' - name: 'personal-page' + name: 'personal_page' rebase: runs-on: ubuntu-latest diff --git a/docker-stack.yaml b/docker-stack.yaml index c49a3fe..b789b4c 100644 --- a/docker-stack.yaml +++ b/docker-stack.yaml @@ -1,7 +1,13 @@ +networks: + reverse_proxy: + external: true + services: page: image: git.alecodes.page/alecodes/page:${GITHUB_SHA:-latest} restart: unless-stopped + networks: + - reverse_proxy deploy: rollback_config: failure_action: continue @@ -14,5 +20,5 @@ services: - node.labels.services_kind==projects labels: - traefik.enable=true - - traefik.http.routers.personal-page.rule=Host(`alecodes.page`) - - traefik.http.services.personal-page.loadbalancer.server.port=80 + - traefik.http.routers.personal_page.rule=Host(`alecodes.page`) + - traefik.http.services.personal_page.loadbalancer.server.port=80