Skip to content

Commit

Permalink
Merge pull request #8 from isd-sgcu/feat/api-ci
Browse files Browse the repository at this point in the history
feat: api ci
  • Loading branch information
ImSoZRious authored Mar 28, 2024
2 parents e3bb65f + 415cc42 commit 6f00d31
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 814 deletions.
38 changes: 18 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,29 @@ on:
branches:
- main

env:
IMAGE_NAME: ghcr.io/isd-sgcu/cutu2024-backend

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- 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
with:
name: api
path: api
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Setup buildx
uses: docker/setup-buildx-action@v2

- uses: actions/upload-artifact@v3
- name: Build and push
uses: docker/build-push-action@v3
with:
name: admin_api
path: admin_api
push: true
path: apps/server
tags: ${{ env.IMAGE_NAME }}:${{ github.ref_type == 'tag' && github.ref_name || github.sha }},${{ 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.

44 changes: 0 additions & 44 deletions apps/admin_api/cmd/main.go

This file was deleted.

Loading

0 comments on commit 6f00d31

Please sign in to comment.