Skip to content

docs: Add system design diagram #4

docs: Add system design diagram

docs: Add system design diagram #4

name: Test and Generate Swagger UI and Coverage
env:
DOMAIN: dcard-backend-intern-2024.peterxcli.dev
on:
pull_request:
branches:
- "*"
push:
branches:
- "*"
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.21.6'
- name: Generate Swagger UI
uses: Legion2/swagger-ui-action@v1
with:
output: public/docs
spec-file: docs/swagger.json
- name: Test and Coverage
env:
APP_REDIS_HOST: localhost
APP_REDIS_PORT: 6379
run: |
mkdir -p public/coverage
go test -coverprofile=coverage.out -v ./...
go tool cover -html=coverage.out -o public/coverage/index.html
- name: Setup CNAME
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: echo $DOMAIN > public/CNAME
- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public