Skip to main content
Glama
ci.yml6.86 kB
name: "CI" on: push: branches: ["*"] pull_request: branches: [main] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: PRODUCTION_URL: ${{ secrets.PRODUCTION_URL || 'https://domestique.fly.dev' }} FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} jobs: test: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v6 - name: Set up Node.js uses: actions/setup-node@v6 with: node-version: '20' cache: 'npm' - name: Install dependencies run: npm ci - name: Type check run: npm run typecheck - name: Run tests run: npm test notify-test: name: Notify test result runs-on: ubuntu-latest needs: test if: always() steps: - name: Set short SHA run: echo "SHORT_SHA=${GITHUB_SHA::8}" >> $GITHUB_ENV - name: Set branch or PR info run: | if [ "${{ github.event_name }}" == "pull_request" ]; then echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV echo "COMMIT_MESSAGE=$(echo "${{ github.event.pull_request.head.commit.message }}" | head -n 1)" >> $GITHUB_ENV echo "BRANCH_URL=${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.pull_request.number }}" >> $GITHUB_ENV else echo "BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_ENV echo "COMMIT_MESSAGE=$(echo "${{ github.event.head_commit.message }}" | head -n 1)" >> $GITHUB_ENV echo "BRANCH_URL=${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}" >> $GITHUB_ENV fi - name: Notify Slack (success) if: needs.test.result == 'success' continue-on-error: true uses: slackapi/slack-github-action@v2.1.1 with: webhook: ${{ secrets.SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | text: "Tests passed on <${{ env.BRANCH_URL }}|`${{ env.BRANCH_NAME }}`>" attachments: - color: "good" fallback: "Tests passed on ${{ env.BRANCH_NAME }}" text: "<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|`${{ env.SHORT_SHA }}`> - ${{ env.COMMIT_MESSAGE }}" footer: "<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}> · <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow>" - name: Notify Slack (failure) if: needs.test.result == 'failure' continue-on-error: true uses: slackapi/slack-github-action@v2.1.1 with: webhook: ${{ secrets.SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | text: "Tests <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|failed> on <${{ env.BRANCH_URL }}|`${{ env.BRANCH_NAME }}`>" attachments: - color: "danger" fallback: "Tests failed on ${{ env.BRANCH_NAME }}" text: "<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|`${{ env.SHORT_SHA }}`> - ${{ env.COMMIT_MESSAGE }}" footer: "<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}> · <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow>" deploy: name: Deploy app runs-on: ubuntu-latest needs: test concurrency: deploy-group if: github.ref == 'refs/heads/main' && github.event_name == 'push' && !contains(github.event.head_commit.message, '[skip deploy]') && !contains(github.event.head_commit.message, '[no deploy]') steps: - name: Set short SHA run: echo "SHORT_SHA=${GITHUB_SHA::8}" >> $GITHUB_ENV - name: Notify Slack (deploy starting) continue-on-error: true uses: slackapi/slack-github-action@v2.1.1 with: webhook: ${{ secrets.SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | text: "Deploy <https://fly.io/apps/domestique/monitoring|starting> :hourglass_flowing_sand:" attachments: - color: "#439FE0" fallback: "Deploy starting: https://fly.io/apps/domestique/monitoring" text: "<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|`${{ env.SHORT_SHA }}`> - ${{ github.event.head_commit.message }}" footer: "<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}> · <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow>" - uses: actions/checkout@v6 - uses: superfly/flyctl-actions/setup-flyctl@master - name: Deploy to Fly.io id: fly_deploy run: flyctl deploy --remote-only env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} - name: Notify Slack (deploy successful) if: success() continue-on-error: true uses: slackapi/slack-github-action@v2.1.1 with: webhook: ${{ secrets.SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | text: "Deploy <${{ env.PRODUCTION_URL }}|successful> :rocket:" attachments: - color: "good" fallback: "Deploy successful: ${{ env.PRODUCTION_URL }}" text: "<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|`${{ env.SHORT_SHA }}`> - ${{ github.event.head_commit.message }}" footer: "<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}> · <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow>" - name: Notify Slack (deploy failed) if: failure() continue-on-error: true uses: slackapi/slack-github-action@v2.1.1 with: webhook: ${{ secrets.SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | text: "Deploy <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|failed> :warning:" attachments: - color: "danger" fallback: "Deploy failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" text: "<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|`${{ env.SHORT_SHA }}`> - ${{ github.event.head_commit.message }}" footer: "<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}> · <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow>"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gesteves/domestique'

If you have feedback or need assistance with the MCP directory API, please join our Discord server