Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
ci(github): fix workflow config for deploy (#136)
Browse files Browse the repository at this point in the history
* ci(github): fix workflow config

* ci(github): update deploy job

* ci(github): fix PR label check
  • Loading branch information
frgfm authored Mar 27, 2024
1 parent f2fc16f commit 441aaff
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,29 @@ jobs:
is-properly-labeled:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install requests
run: pip install requests
- uses: actions/checkout@v4
- name: Process commit and find merger responsible for labeling
id: commit
run: echo "::set-output name=merger::$(python .github/verify_labels.py ${{ github.event.pull_request.number }})"
run: |
MERGER=$(python .github/verify_labels.py ${{ github.event.pull_request.number }})
echo "merger=${MERGER}" | tee --append $GITHUB_OUTPUT
- name: Comment PR
uses: actions/github-script@v7
if: ${{ steps.commit.outputs.merger != '' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
github.issues.createComment({ issue_number, owner, repo, body: 'Hey ${{ steps.commit.outputs.merger }} 👋\nYou merged this PR, but it is not correctly labeled. The list of valid labels is available at https://github.com/quack-ai/companion/blob/main/.github/verify_labels.py' });
github.rest.issues.createComment({
issue_number,
owner,
repo,
body: 'Hey ${{ steps.commit.outputs.merger }} 👋\nYou merged this PR, but it is not correctly labeled. The list of valid labels is available at https://github.com/quack-ai/contribution-api/blob/main/.github/verify_labels.py'
});
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
docker push $IMAGE_ID:latest
deploy-dev:
needs: dockerhub
needs: docker
runs-on: ubuntu-latest
steps:
- uses: appleboy/[email protected]
Expand All @@ -65,7 +65,7 @@ jobs:
script: |
docker pull quackai/contribution-api:latest
docker rmi -f $(docker images -f "dangling=true" -q)
cd devops && docker compose stop backend && docker compose up -d && docker compose exec backend alembic upgrade head
cd devops && docker compose stop backend && docker compose up -d --wait && docker compose exec backend alembic upgrade head
docker inspect -f '{{ .Created }}' $(docker compose images -q backend)
- name: Ping server
env:
Expand Down

0 comments on commit 441aaff

Please sign in to comment.