Merge pull request #38 from Molecule-AI/fix/ci-canvas-deploy-reminder
ci: post canvas deploy reminder after every main merge
This commit is contained in:
commit
34573d6a1d
38
.github/workflows/ci.yml
vendored
38
.github/workflows/ci.yml
vendored
@ -176,6 +176,44 @@ jobs:
|
||||
with:
|
||||
scandir: tests/e2e
|
||||
|
||||
canvas-deploy-reminder:
|
||||
name: Canvas Deploy Reminder
|
||||
runs-on: ubuntu-latest
|
||||
needs: canvas-build
|
||||
# Only fires on direct pushes to main (i.e. after a PR merges).
|
||||
# PRs get canvas-build CI but no reminder — no deployment happens on PRs.
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
permissions:
|
||||
# Required to post commit comments via the GitHub API.
|
||||
contents: write
|
||||
steps:
|
||||
- name: Post deploy reminder as commit comment
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
COMMIT_SHA: ${{ github.sha }}
|
||||
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
run: |
|
||||
# Write body to a temp file — avoids backtick escaping in shell.
|
||||
cat > /tmp/deploy-reminder.md << 'BODY'
|
||||
## Canvas build passed ✅ — deploy required
|
||||
|
||||
The canvas container is **not auto-deployed**. Merged canvas changes are invisible until the host container is rebuilt.
|
||||
|
||||
Run this on the host machine to apply:
|
||||
```bash
|
||||
cd /g/personal_programs/molecule-monorepo
|
||||
git pull origin main
|
||||
docker compose build canvas && docker compose up -d canvas
|
||||
```
|
||||
BODY
|
||||
printf '\n> Posted automatically by CI · commit `%s` · [build log](%s)\n' \
|
||||
"$COMMIT_SHA" "$RUN_URL" >> /tmp/deploy-reminder.md
|
||||
|
||||
gh api \
|
||||
--method POST \
|
||||
"repos/${{ github.repository }}/commits/${{ github.sha }}/comments" \
|
||||
--field "body=@/tmp/deploy-reminder.md"
|
||||
|
||||
python-lint:
|
||||
name: Python Lint & Test
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
Loading…
Reference in New Issue
Block a user