Skip to content

Commit

Permalink
Merge pull request #14 from isd-sgcu/JOH-37/publish
Browse files Browse the repository at this point in the history
[JOH-37] Publish
  • Loading branch information
bookpanda authored Jan 6, 2024
2 parents 026adc0 + 77b8309 commit dda5c66
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 17 deletions.
45 changes: 34 additions & 11 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- beta
- dev

env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
IMAGE_TAG: ${{ github.sha }}

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -18,7 +22,6 @@ jobs:
with:
go-version: 1.21
check-latest: true
cache: true

- name: Download dependencies
run: go mod download
Expand All @@ -36,21 +39,41 @@ jobs:
go tool cover -func="./coverage.out"
build:
name: Build
runs-on: ubuntu-latest
needs:
- test

permissions:
contents: read
packages: write

outputs:
BRANCH: ${{ steps.branch.outputs.BRANCH }}

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build Docker image
id: docker_build

- name: Set branch
id: branch
run: |
echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
- name: Log in to the Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
context: .
push: false
tags: test
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }},${{ env.IMAGE_NAME }}:latest
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
1 change: 0 additions & 1 deletion .github/workflows/run-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
with:
go-version: 1.21
check-latest: true
cache: true

- name: Download dependencies
run: go mod download
Expand Down
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# Johnjud-auth

Johnjud-auth is a user authentication and authorization service for the Johnjud project.

### What is Johnjud?
Johnjud is a pet adoption web application of the [CUVET For Animal Welfare Club](https://www.facebook.com/CUVETforAnimalWelfareClub)

## Stacks
- golang
- gRPC
- postgresql
- redis

## Getting Start
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites
- golang 1.19 or [later](https://go.dev)
- golang 1.21 or [later](https://go.dev)
- docker
- makefile

Expand All @@ -18,9 +24,19 @@ These instructions will get you a copy of the project up and running on your loc
2. Import project
3. Copy `config.example.yaml` in `config` and paste it in the same location then remove `.example` from its name.
4. Download dependencies by `go mod download`
### Testing
1. Run ` go test -v -coverpkg ./src/internal/... -coverprofile coverage.out -covermode count ./src/internal/...` or `make test`

### Running
1. Run `docker-compose up -d`
2. Run `go run ./src/.` or `make server`
2. Run `go run ./cmd/.` or `make server`

### Testing
1. Run `go test -v -coverpkg ./internal/... -coverprofile coverage.out -covermode count ./internal/...` or `make test`

## Other microservices/repositories of Johnjud
- [Johnjud-gateway](https://github.com/isd-sgcu/johnjud-gateway): Routing and request handling
- [Johnjud-auth](https://github.com/isd-sgcu/johnjud-auth): Authentication and authorization
- [Johnjud-backend](https://github.com/isd-sgcu/johnjud-backend): Main business logic
- [Johnjud-file](https://github.com/isd-sgcu/johnjud-file): File management service
- [Johnjud-proto](https://github.com/isd-sgcu/johnjud-proto): Protobuf files generator
- [Johnjud-go-proto](https://github.com/isd-sgcu/johnjud-go-proto): Generated protobuf files for golang
- [Johnjud-frontend](https://github.com/isd-sgcu/johnjud-frontend): Frontend web application

0 comments on commit dda5c66

Please sign in to comment.