Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-implement the API using Golang #112

Draft
wants to merge 27 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bb27fdc
Tafseer API v2 (Golang version) (#102)
EmadMokhtar Apr 14, 2024
bec3d28
V2/docker image (#107)
EmadMokhtar Apr 21, 2024
01b6951
V2/fix ga tagging (#110)
EmadMokhtar Apr 21, 2024
eb10d10
fix semver action
EmadMokhtar Apr 21, 2024
31f6a05
Improve the github actions
EmadMokhtar Apr 21, 2024
b0e2786
Improve the github actions
EmadMokhtar Apr 21, 2024
4ede8a3
Trying the git version action
EmadMokhtar Apr 26, 2024
37d07a9
Trying the git version action
EmadMokhtar Apr 26, 2024
20cb6e0
Add the git-version
EmadMokhtar Apr 26, 2024
9ae7f30
Add the git-version
EmadMokhtar Apr 26, 2024
287e0fc
Try version bump
EmadMokhtar Apr 26, 2024
f7798a7
Try version bump: take 2
EmadMokhtar Apr 28, 2024
e7d5167
Try version bump: take 3
EmadMokhtar Apr 28, 2024
8b8a997
Try version bump: take 4
EmadMokhtar Apr 28, 2024
26aac21
break: Golang version
EmadMokhtar Apr 28, 2024
055018c
break: Golang version
EmadMokhtar Apr 28, 2024
f4716cc
break: Golang version
EmadMokhtar Apr 28, 2024
a18367f
major: Golang version
EmadMokhtar Apr 28, 2024
2b89e52
V2/semver action 2 (#111)
EmadMokhtar Apr 28, 2024
b6f479a
Add echo for debugging
EmadMokhtar Apr 28, 2024
1855fb6
Improve the github action (#113)
EmadMokhtar Apr 28, 2024
7a32e81
V2/test tagging 2 (#114)
EmadMokhtar Apr 28, 2024
a033e86
Implement CD actions (#115)
EmadMokhtar Apr 28, 2024
a13a092
Push new image to Docker registry (#116)
EmadMokhtar Apr 28, 2024
27f1fb8
Push new image to Docker registry (#117)
EmadMokhtar Apr 28, 2024
9a40088
Push new image to Docker registry (#118)
EmadMokhtar Apr 28, 2024
cc6314e
V2/cd v1.3 (#119)
EmadMokhtar Apr 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .coveragerc

This file was deleted.

11 changes: 10 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
DEBUG=False
DB_HOST={datbase_name}
DB_PORT=5432
DB_NAME={database_name}
DB_USER={database_user}
DB_PASS={database_password}
DB_SSLMODE=disable
LOG_LEVEL=debug
ADDR=0.0.0.0
PORT=8080
ENV=dev
56 changes: 56 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Continuous Deployment

on:
pull_request:
types: [closed]
branches: ['master', 'v2/master']

env:
IMAGE_NAME: tafseer_api

jobs:
release:
name: "GitHub Release & Docker Hub Push"
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Get version
id: get_version
run: |
echo ::set-output name=VERSION::$(cat git-version)

- name: Bump version and create tag
id: bump_version
uses: mathieudutour/github-tag-action@v5.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: patch
release_branches: master,v2/master
custom_tag: ${{ steps.get_version.outputs.VERSION }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.bump_version.outputs.new_tag }}
release_name: Release ${{ steps.bump_version.outputs.new_tag }}
draft: false
prerelease: false

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }}
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Countinue Integration

on:
push:
branches:
- master
- v2/master
pull_request:

permissions:
contents: write

jobs:
golang-ci:
name: Go lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.54

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
#
# Note: By default, the `.golangci.yml` file should be at the root of the repository.
# The location of the configuration file can be changed by using `--config=`
# args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true, then all caching functionality will be completely disabled,
# takes precedence over all other caching options.
# skip-cache: true

# Optional: if set to true, then the action won't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true, then the action won't cache or restore ~/.cache/go-build.
# skip-build-cache: true

# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
# install-mode: "goinstall"

golang-test:
name: Go tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Build
run: go build -v ./...

- name: Test
uses: robherley/go-test-action@v0
Loading