Conversation
Updated the deployment workflow to use the control_dev image and added environment variables for the container.
* file change : api * migrate ambigious directory name request into client * Add pkg directory for containing lower bound dependancy-free packages (easy-cloud-Knet#42) Merge pkg structure migration to Control logic. None of functional changes has applied but, structural refactoring for reduce of dependency has been applied. * resolve previous build error --------- Co-authored-by: wind5052 <wind5052@naver.com> Co-authored-by: Minhyeok <ga111o@proton.me>
There was a problem hiding this comment.
Pull request overview
This PR introduces a GitHub Actions workflow to verify PR builds and updates the existing deploy workflow’s container run configuration.
Changes:
- Added a new PR workflow (
pr-check.yaml) to rungo mod download+go build, and request changes on failure. - Updated the deploy workflow to run a container with different image tag/port mapping and additional environment variables.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| .github/workflows/pr-check.yaml | New PR build verification workflow, including a failure review comment step. |
| .github/workflows/deploy.yaml | Adjusts container image reference and expands docker run args (ports, env vars, host mapping). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.23.x' | ||
|
|
||
| - name: Download Go modules | ||
| run: go mod download | ||
|
|
||
| - name: Build | ||
| run: go build -o main . | ||
|
|
||
| - name: Comment on failure | ||
| if: failure() | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| await github.rest.pulls.createReview({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: context.payload.pull_request.number, | ||
| event: 'REQUEST_CHANGES', | ||
| body: 'Failed To BUILD! Please check the build logs for details.' | ||
| }); |
There was a problem hiding this comment.
steps: list items are not indented under steps. With the current indentation, the - name: ... entries become siblings of steps and the workflow YAML will not parse. Indent step items under steps: (e.g., steps: then - name:).
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23.x' | |
| - name: Download Go modules | |
| run: go mod download | |
| - name: Build | |
| run: go build -o main . | |
| - name: Comment on failure | |
| if: failure() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| await github.rest.pulls.createReview({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.payload.pull_request.number, | |
| event: 'REQUEST_CHANGES', | |
| body: 'Failed To BUILD! Please check the build logs for details.' | |
| }); | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23.x' | |
| - name: Download Go modules | |
| run: go mod download | |
| - name: Build | |
| run: go build -o main . | |
| - name: Comment on failure | |
| if: failure() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| await github.rest.pulls.createReview({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.payload.pull_request.number, | |
| event: 'REQUEST_CHANGES', | |
| body: 'Failed To BUILD! Please check the build logs for details.' | |
| }); |
| - name: Comment on failure | ||
| if: failure() | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| await github.rest.pulls.createReview({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: context.payload.pull_request.number, | ||
| event: 'REQUEST_CHANGES', | ||
| body: 'Failed To BUILD! Please check the build logs for details.' |
There was a problem hiding this comment.
The actions/github-script step calls pulls.createReview, which requires pull-requests: write permission. This workflow doesn't set explicit permissions, so the step may fail (especially on orgs that default GITHUB_TOKEN to read-only / on fork PRs). Consider adding permissions: pull-requests: write (and gating fork PRs if needed) so the failure comment is reliable.
| - name: Deploy container locally | ||
| run: | | ||
| IMAGE=${{ secrets.DOCKER_HUB_USERNAME }}/control_deploy:latest | ||
| IMAGE=${{ secrets.DOCKER_HUB_USERNAME }}/control_dev:latest |
There was a problem hiding this comment.
IMAGE is set to .../control_dev:latest, but this workflow currently builds/tags .../control_deploy:latest earlier in the job. As written, docker run $IMAGE will either fail (image not found) or pull a different image than the one just built. Align the image name/tag between the build step and the deploy step.
| IMAGE=${{ secrets.DOCKER_HUB_USERNAME }}/control_dev:latest | |
| IMAGE=${{ secrets.DOCKER_HUB_USERNAME }}/control_deploy:latest |
| docker run -d --name CONTROL_DEPLOY -p 8083:8081 --restart=always \ | ||
| --add-host host.docker.internal:host-gateway \ | ||
| -e CORES="${{ secrets.CORES }}" \ | ||
| -e DB_USER="${{ secrets.DB_USER }}" \ | ||
| -e DB_PASSWORD="${{ secrets.DB_PASSWORD }}" \ |
There was a problem hiding this comment.
The docker run command uses \\ at end-of-line for continuation inside the bash script. In bash, \\ escapes the second backslash and does not escape the newline, so the command will break into multiple commands. Use a single trailing \ for line continuation (or remove continuations and keep it on one line).
| @@ -0,0 +1,38 @@ | |||
| name: PR Build Verification | |||
There was a problem hiding this comment.
The PR title/description don't describe the intent or expected behavior of these workflow changes (they still contain the template placeholders). Please update the PR description to explain what the new PR build check is for and why the deploy workflow’s container settings (ports/env vars/image name) changed.
Summary
Motivation
Approach
Type of Change
Related Issue
Testing
Checklist