fix(fe): prevent course delete modal from opening without selection (… #424
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
| # This workflow only builds and pushes Docker images. | |
| # The rest of the deployment process is handled by ArgoCD. | |
| name: CD - Stage | |
| on: | |
| push: | |
| branches: [main, hotfix-cd-stage] | |
| permissions: | |
| contents: read | |
| packages: write | |
| pull-requests: read | |
| jobs: | |
| build-and-push: | |
| name: Build and Push Image | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| target: | |
| - target: client-api | |
| file: ./apps/backend/Dockerfile | |
| context: . | |
| build-args: | | |
| target=client | |
| app_env=stage | |
| - target: admin-api | |
| file: ./apps/backend/Dockerfile | |
| context: . | |
| build-args: | | |
| target=admin | |
| app_env=stage | |
| - target: iris | |
| file: '' | |
| context: apps/iris | |
| build-args: | | |
| app_env=stage | |
| - target: plag | |
| file: '' | |
| context: apps/plag | |
| build-args: | | |
| app_env=stage | |
| - target: runner-pod-manager | |
| file: '' | |
| context: apps/runner/pod-manager | |
| build-args: '' | |
| - target: runner | |
| file: '' | |
| context: apps/runner/backend | |
| build-args: '' | |
| steps: | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| file: ${{ matrix.target.file }} | |
| context: '{{defaultContext}}:${{ matrix.target.context }}' | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| push: true | |
| build-args: ${{ matrix.target.build-args }} | |
| tags: | | |
| ghcr.io/skkuding/codedang-${{ matrix.target.target }}:${{ github.sha }} | |
| ghcr.io/skkuding/codedang-${{ matrix.target.target }}:stage | |
| ghcr.io/skkuding/codedang-${{ matrix.target.target }}:latest | |
| build-frontend: | |
| name: Build and Push Image (Frontend) | |
| runs-on: arc-runner | |
| steps: | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Detect PR number | |
| id: pr | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { owner, repo } = context.repo; | |
| const res = await github.rest.repos.listPullRequestsAssociatedWithCommit({ | |
| owner, repo, commit_sha: context.sha | |
| }); | |
| const num = res.data?.[0]?.number || ''; | |
| core.setOutput('number', String(num)); | |
| - name: Build and push image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| file: ./apps/frontend/Dockerfile | |
| context: '{{defaultContext}}:.' | |
| cache-from: | | |
| type=registry,ref=ghcr.io/skkuding/codedang-frontend:cache-${{ steps.pr.outputs.number || 'stage' }} | |
| type=registry,ref=ghcr.io/skkuding/codedang-frontend:cache-stage | |
| cache-to: type=registry,ref=ghcr.io/skkuding/codedang-frontend:cache-stage | |
| push: true | |
| build-args: | | |
| BASEURL=https://stage.codedang.com/api | |
| GQL_BASEURL=https://stage.codedang.com/graphql | |
| RUNNER_BASEURL=wss://run.stage.codedang.com/run | |
| ADMIN_REST_URL=https://stage.codedang.com/admin-api | |
| tags: | | |
| ghcr.io/skkuding/codedang-frontend:${{ github.sha }} | |
| ghcr.io/skkuding/codedang-frontend:stage | |
| ghcr.io/skkuding/codedang-frontend:latest |