Skip to content

Commit

Permalink
Merge branch 'main' into feat/api
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickChoDev authored Mar 30, 2024
2 parents 61b3b24 + 60644bd commit e7b52ca
Show file tree
Hide file tree
Showing 49 changed files with 1,110 additions and 1,252 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'CD'

on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Rollout new deployment
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: rollout restart deployment/cutu2024-backend
46 changes: 28 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,42 @@ on:
push:
branches:
- main
workflow_dispatch:

env:
IMAGE_NAME: registry.digitalocean.com/cutu2024/cutu2024-backend

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
server:
- 'apps/server/**'
- name: Build api go application
env:
CGO_ENABLED: 0
GOOS: linux
run: go build -C apps/api -o api ./... && cp apps/api/api .

- name: Build admin-api go application
env:
CGO_ENABLED: 0
GOOS: linux
run: go build -C apps/admin_api -o admin_api ./... && cp apps/admin_api/admin_api .

- uses: actions/upload-artifact@v3
- name: Login to registry
uses: docker/login-action@v2
if: steps.changes.outputs.server == 'true'
with:
name: api
path: api
registry: registry.digitalocean.com
username: ${{ secrets.do_username }}
password: ${{ secrets.do_token }}

- name: Setup buildx
uses: docker/setup-buildx-action@v2
if: steps.changes.outputs.server == 'true'

- uses: actions/upload-artifact@v3
- name: Build and push
uses: docker/build-push-action@v3
if: steps.changes.outputs.server == 'true'
with:
name: admin_api
path: admin_api
push: true
context: "{{defaultContext}}:apps/server"
tags: ${{ env.IMAGE_NAME }}:latest
cache-from: type=gha,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=gha,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
23 changes: 0 additions & 23 deletions apps/admin_api/Dockerfile

This file was deleted.

77 changes: 0 additions & 77 deletions apps/admin_api/cmd/broadcaster.go

This file was deleted.

132 changes: 0 additions & 132 deletions apps/admin_api/cmd/client.go

This file was deleted.

49 changes: 0 additions & 49 deletions apps/admin_api/cmd/hub.go

This file was deleted.

Loading

0 comments on commit e7b52ca

Please sign in to comment.