Skip to content

Commit 53fa72f

Browse files
committed
first commit
0 parents  commit 53fa72f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+8714
-0
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git
2+
.gitignore
3+
.env
4+
target
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "Bug Report"
2+
description: "File a bug report."
3+
title: "[Bug]: "
4+
labels: ["bug", "triage"]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Thanks for taking the time to fill out this bug report!
11+
- type: input
12+
id: contact
13+
attributes:
14+
label: Contact Details
15+
description: How can we get in touch with you if we need more info?
16+
placeholder: ex. email@example.com
17+
validations:
18+
required: false
19+
- type: textarea
20+
id: what-happened
21+
attributes:
22+
label: What happened?
23+
description: Also tell us, what did you expect to happen?
24+
placeholder: Tell us what you see!
25+
value: "A bug happened!"
26+
validations:
27+
required: true
28+
- type: dropdown
29+
id: States
30+
attributes:
31+
label: State
32+
description: In what state of the project did this error appear
33+
options:
34+
- Development⚠️
35+
- Production🆘
36+
default: 0
37+
validations:
38+
required: true
39+
- type: dropdown
40+
id: Stages
41+
attributes:
42+
label: Which stage of development did this error appear
43+
multiple: true
44+
options:
45+
- Local📲
46+
- Development container🐋
47+
- Production compose container🐋
48+
- Production cluster⎈
49+
default: 0
50+
- type: textarea
51+
id: logs
52+
attributes:
53+
label: Relevant log output
54+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
55+
render: shell

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
blank_issues_enabled: false
2+
3+
contact_links:
4+
- name: 💬 Ask me a Question
5+
url: https://t.me/kamranTheGreatest
6+
about: Here my contacts

.github/workflows/dev.workflow.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Dev Workflow
2+
on:
3+
push:
4+
branches:
5+
- dev
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
ACTOR: ${{ github.actor }}
10+
REPOSITORY: ${{ github.repository }}
11+
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
12+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Build
21+
run: cargo build --verbose
22+
23+
- name: Build Docker images
24+
run: |
25+
docker compose build
26+
27+
test:
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Testing
33+
run: |
34+
cargo test --verbose
35+
36+
deploy:
37+
needs: [test]
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Login to Docker Hub
42+
uses: docker/login-action@v3
43+
with:
44+
username: ${{ vars.DOCKERHUB_USERNAME }}
45+
password: ${{ secrets.DOCKERHUB_TOKEN }}
46+
47+
- name: Build and push
48+
uses: docker/build-push-action@v6
49+
with:
50+
file: ./compose/.development/backend/Dockerfile
51+
context: .
52+
push: true
53+
tags: wrldengine/rust_actix_boilerplate:latest
54+
55+
notify_email:
56+
needs: [deploy]
57+
runs-on: ubuntu-latest
58+
59+
steps:
60+
- name: Install sendmail
61+
run: sudo apt update && sudo apt install -y sendmail postfix
62+
63+
- uses: actions/checkout@v2
64+
- name: Notify By Email
65+
run: |
66+
chmod +x ./scripts/email_notify.sh
67+
bash ./scripts/email_notify.sh
68+
env:
69+
NOTIFY_SMTP_SERVER: ${{ secrets.NOTIFY_SMTP_SERVER }}
70+
NOTIFY_SMTP_PORT: ${{ secrets.NOTIFY_SMTP_PORT }}
71+
NOTIFY_SMTP_PASSWORD: ${{ secrets.NOTIFY_SMTP_PASSWORD }}
72+
NOTIFY_SMTP_USER: ${{ secrets.NOTIFY_SMTP_USER }}
73+
NOTIFY_SMTP_TO: ${{ secrets.NOTIFY_SMTP_TO }}
74+
75+
76+
notify_telegram:
77+
needs: [deploy]
78+
runs-on: ubuntu-latest
79+
80+
steps:
81+
- uses: actions/checkout@v2
82+
- name: Notify By Telegram bot
83+
run: |
84+
chmod +x ./scripts/telegram_notify.sh
85+
bash ./scripts/telegram_notify.sh
86+
env:
87+
CICD_BOT_TOKEN: ${{ secrets.CICD_BOT_TOKEN }}
88+
CICD_GROUP: ${{ secrets.CICD_GROUP }}
89+
ACTOR: ${{ github.actor }}
90+
REPOSITORY: ${{ github.repository }}
91+
GITHUB_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
92+
GITHUB_SHA: ${{ github.sha }}
93+
RUN_ID: ${{ github.run_id }}
94+
DEPLOY_RESULT: ${{ needs.deploy.result }}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Prod Workflow
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
ACTOR: ${{ github.actor }}
10+
REPOSITORY: ${{ github.repository }}
11+
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
12+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Build
21+
run: cargo build --verbose
22+
23+
- name: Build Docker images
24+
run: |
25+
docker compose build
26+
27+
test:
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Testing
33+
run: |
34+
cargo test --verbose
35+
36+
deploy:
37+
needs: [test]
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Login to Docker Hub
42+
uses: docker/login-action@v3
43+
with:
44+
username: ${{ vars.DOCKERHUB_USERNAME }}
45+
password: ${{ secrets.DOCKERHUB_TOKEN }}
46+
47+
- name: Build and push
48+
uses: docker/build-push-action@v6
49+
with:
50+
file: ./compose/.production/backend/Dockerfile
51+
context: .
52+
push: true
53+
tags: wrldengine/rust_actix_boilerplate:latest
54+
55+
notify_email:
56+
needs: [deploy]
57+
runs-on: ubuntu-latest
58+
59+
steps:
60+
- name: Install sendmail
61+
run: sudo apt update && sudo apt install -y sendmail postfix
62+
63+
- uses: actions/checkout@v2
64+
- name: Notify By Email
65+
run: |
66+
chmod +x ./scripts/email_notify.sh
67+
bash ./scripts/email_notify.sh
68+
env:
69+
NOTIFY_SMTP_SERVER: ${{ secrets.NOTIFY_SMTP_SERVER }}
70+
NOTIFY_SMTP_PORT: ${{ secrets.NOTIFY_SMTP_PORT }}
71+
NOTIFY_SMTP_PASSWORD: ${{ secrets.NOTIFY_SMTP_PASSWORD }}
72+
NOTIFY_SMTP_USER: ${{ secrets.NOTIFY_SMTP_USER }}
73+
NOTIFY_SMTP_TO: ${{ secrets.NOTIFY_SMTP_TO }}
74+
75+
76+
notify_telegram:
77+
needs: [deploy]
78+
runs-on: ubuntu-latest
79+
80+
steps:
81+
- uses: actions/checkout@v2
82+
- name: Notify By Telegram bot
83+
run: |
84+
chmod +x ./scripts/telegram_notify.sh
85+
bash ./scripts/telegram_notify.sh
86+
env:
87+
CICD_BOT_TOKEN: ${{ secrets.CICD_BOT_TOKEN }}
88+
CICD_GROUP: ${{ secrets.CICD_GROUP }}
89+
ACTOR: ${{ github.actor }}
90+
REPOSITORY: ${{ github.repository }}
91+
GITHUB_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
92+
GITHUB_SHA: ${{ github.sha }}
93+
RUN_ID: ${{ github.run_id }}
94+
DEPLOY_RESULT: ${{ needs.deploy.result }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/target
2+
3+
*.env

.gitlab-ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This file is a template, and might need editing before it works on your project.
2+
# This is a sample GitLab CI/CD configuration file that should run without any modifications.
3+
# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
4+
# it uses echo commands to simulate the pipeline execution.
5+
#
6+
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
7+
# Stages run in sequential order, but jobs within stages run in parallel.
8+
#
9+
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
10+
#
11+
# You can copy and paste this template into a new `.gitlab-ci.yml` file.
12+
# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword.
13+
#
14+
# To contribute improvements to CI/CD templates, please follow the Development guide at:
15+
# https://docs.gitlab.com/ee/development/cicd/templates.html
16+
# This specific template is located at:
17+
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
18+
19+
stages:
20+
- build
21+
- test
22+
- deploy
23+
24+
build-job:
25+
stage: build
26+
script:
27+
- echo "Compiling the code..."
28+
- echo "Compile complete."
29+
30+
unit-test-job:
31+
stage: test
32+
script:
33+
- echo "Running unit tests... This will take about 60 seconds."
34+
- sleep 60
35+
- echo "Code coverage is 90%"
36+
37+
lint-test-job:
38+
stage: test
39+
script:
40+
- echo "Linting code... This will take about 10 seconds."
41+
- sleep 10
42+
- echo "No lint issues found."
43+
44+
deploy-job:
45+
stage: deploy
46+
environment: production
47+
script:
48+
- echo "Deploying application..."
49+
- echo "Application successfully deployed."

.pre-commit-config.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
exclude: "docs|node_modules|migrations|env|config|.git|.tox|target"
2+
default_stages: [commit]
3+
fail_fast: true
4+
5+
repos:
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v5.0.0
8+
hooks:
9+
- id: check-merge-conflict
10+
- id: check-added-large-files
11+
- id: check-ast
12+
- id: check-symlinks
13+
- id: check-yaml
14+
- id: trailing-whitespace
15+
- id: check-json
16+
- id: debug-statements
17+
- id: pretty-format-json
18+
19+
- repo: local
20+
hooks:
21+
- id: rustfmt
22+
name: rustfmt
23+
description: Check if all files follow the rustfmt style
24+
entry: cargo fmt --all --check -- --color always
25+
language: system
26+
pass_filenames: false
27+
28+
- id: cargocheck
29+
name: cargocheck
30+
description: Cargo checking
31+
entry: cargo check
32+
language: system
33+
pass_filenames: false

0 commit comments

Comments
 (0)