Merge pull request #112 from DrexelTriangle/patch/media-url-canonical… #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| backend: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: server | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: server/go.mod | |
| cache-dependency-path: server/go.sum | |
| - name: Test | |
| run: go test ./... | |
| - name: Race test | |
| run: go test -race ./... | |
| - name: Vet | |
| run: go vet ./... | |
| frontend: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Clean install | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Build | |
| run: npm run build | |
| docker-builds: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Build backend image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./server | |
| file: ./server/Dockerfile | |
| push: false | |
| tags: triangle-cms-backend:${{ github.sha }} | |
| cache-from: type=gha,scope=backend | |
| cache-to: type=gha,mode=max,scope=backend | |
| - name: Build frontend image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./frontend | |
| file: ./frontend/Dockerfile | |
| push: false | |
| tags: triangle-cms-frontend:${{ github.sha }} | |
| cache-from: type=gha,scope=frontend | |
| cache-to: type=gha,mode=max,scope=frontend | |
| # The deployment scripts are the least reversible code in the repo, so their | |
| # test suite runs on every PR. It stubs docker/curl/nginx on PATH and needs no | |
| # daemon, database, or privileges. | |
| deploy-scripts: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Deploy script tests | |
| run: deploy/scripts/deploy_scripts_test.sh | |
| compose-validation: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate Delta Compose config | |
| env: | |
| CMS_IMAGE_TAG: ${{ github.sha }} | |
| DB_NAME: triangle | |
| DB_USER: triangle_user | |
| DB_PASSWORD: ci-placeholder | |
| DB_HOST: db-host-placeholder | |
| DB_PORT: "3306" | |
| OIDC_ISSUER_URL: http://oidc-placeholder.invalid | |
| OIDC_CLIENT_ID: ci-placeholder | |
| OIDC_CLIENT_SECRET: ci-placeholder | |
| FRONTEND_ORIGIN: http://delta-placeholder | |
| OIDC_REDIRECT_URI: http://delta-placeholder/auth/callback | |
| run: docker compose -f deploy/compose.cms.yml config >/dev/null |