Update CI/CD badges in README #23
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
| name: Deploy Code-Native Integrations | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| # Get a list of integrations to deploy | |
| list-integrations: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| integrations: ${{ steps.list-integrations.outputs.integrations }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: List integrations | |
| id: list-integrations | |
| run: | | |
| integrations=$(ls -d integrations/*/ | xargs -n 1 basename | jq -R -s -c 'split("\n")[:-1]') | |
| echo "integrations=$integrations" >> "$GITHUB_OUTPUT" | |
| build-integrations: | |
| runs-on: ubuntu-latest | |
| needs: [list-integrations] | |
| strategy: | |
| matrix: | |
| integration: ${{ fromJson(needs.list-integrations.outputs.integrations) }} | |
| fail-fast: false | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Check if integration needs publishing | |
| id: integration-filter | |
| uses: dorny/paths-filter@v3.0.2 | |
| with: | |
| filters: | | |
| integration: | |
| - 'integrations/${{ matrix.integration }}/**' | |
| - 'shared-libs/${{ matrix.integration }}/**' | |
| - 'shared-libs/acme/**' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6.0.0 | |
| with: | |
| node-version: "24.10.0" | |
| if: steps.integration-filter.outputs.integration == 'true' | |
| - name: Install dependencies | |
| run: npm install | |
| if: steps.integration-filter.outputs.integration == 'true' | |
| - name: Build ${{ matrix.integration }} integration | |
| run: npm run build | |
| working-directory: ./integrations/${{ matrix.integration }} | |
| env: | |
| SLACK_CLIENT_ID: ${{ secrets.SLACK_CLIENT_ID }} | |
| SLACK_CLIENT_SECRET: ${{ secrets.SLACK_CLIENT_SECRET }} | |
| SLACK_SIGNING_SECRET: ${{ secrets.SLACK_SIGNING_SECRET }} | |
| TODOIST_CLIENT_ID: ${{ secrets.TODOIST_CLIENT_ID }} | |
| TODOIST_CLIENT_SECRET: ${{ secrets.TODOIST_CLIENT_SECRET }} | |
| if: steps.integration-filter.outputs.integration == 'true' | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.integration }}-build | |
| path: ./integrations/${{ matrix.integration }}/dist | |
| if: steps.integration-filter.outputs.integration == 'true' | |
| publish-integrations: | |
| runs-on: ubuntu-latest | |
| needs: [list-integrations, build-integrations] | |
| strategy: | |
| matrix: | |
| integration: ${{ fromJson(needs.list-integrations.outputs.integrations) }} | |
| environment: [australia, canada] | |
| fail-fast: false | |
| environment: | |
| name: ${{ matrix.environment }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Check if integration needs publishing | |
| id: integration-filter | |
| uses: dorny/paths-filter@v3.0.2 | |
| with: | |
| filters: | | |
| integration: | |
| - 'integrations/${{ matrix.integration }}/**' | |
| - 'shared-libs/${{ matrix.integration }}/**' | |
| - 'shared-libs/acme/**' | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ matrix.integration }}-build | |
| path: ./integrations/${{ matrix.integration }}/dist | |
| if: steps.integration-filter.outputs.integration == 'true' | |
| - name: Set integration ID var name | |
| id: integration_id | |
| run: | | |
| echo "integration_id=INTEGRATION_ID_$(echo ${{ matrix.integration }} | tr '[:lower:]' '[:upper:]')" >> $GITHUB_OUTPUT | |
| if: steps.integration-filter.outputs.integration == 'true' | |
| - name: Fail if integration ID var not set | |
| run: | | |
| if [ -z "${{ vars[steps.integration_id.outputs.integration_id] }}" ]; then | |
| echo "Error: Integration ID for ${{ matrix.integration }} in ${{ matrix.environment }} is not set in repository variables." | |
| exit 1 | |
| fi | |
| if: steps.integration-filter.outputs.integration == 'true' | |
| - name: Publish ${{ matrix.integration }} to ${{ matrix.environment }} | |
| uses: prismatic-io/integration-publisher@v1.4 | |
| with: | |
| PATH_TO_CNI: ./integrations/${{ matrix.integration }} | |
| PRISMATIC_URL: ${{ vars.PRISMATIC_URL }} | |
| PRISM_REFRESH_TOKEN: ${{ secrets.PRISM_REFRESH_TOKEN }} | |
| MAKE_AVAILABLE_IN_MARKETPLACE: false | |
| INTEGRATION_ID: ${{ vars[steps.integration_id.outputs.integration_id] }} | |
| if: steps.integration-filter.outputs.integration == 'true' | |
| - name: Note if integration did not need publishing | |
| run: | | |
| echo "No changes detected in the ${{ matrix.integration }} integration. Skipping publish step." >> "$GITHUB_STEP_SUMMARY" | |
| if: steps.integration-filter.outputs.integration == 'false' |