Merge pull request #114 from ThatConference/fix/stellate-action-task #24
This file contains 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: CI on Push Master | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build Gateway API for deploy | |
uses: thatconference/that-gh-actions/.github/workflows/build-validate-api.yml@main | |
with: | |
apiName: gateway | |
isForDeploy: true | |
branchName: ${{ github.ref_name }} | |
nodeVersion: 20 | |
secrets: | |
SLACK_WEBHOOK_DEV_NOTIFICATIONS: ${{ secrets.SLACK_WEBHOOK_DEV_NOTIFICATIONS }} | |
deploy: | |
name: Deploy Gateway API to Google Run | |
needs: build | |
uses: thatconference/that-gh-actions/.github/workflows/deploy-api.yml@main | |
with: | |
apiName: gateway | |
runMemory: 256Mi | |
gcpSecretName: prod-api-gateway-env | |
secrets: | |
GCLOUD_AUTH: ${{ secrets.GCLOUD_AUTH }} | |
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} | |
SLACK_WEBHOOK_DEV_NOTIFICATIONS: ${{ secrets.SLACK_WEBHOOK_DEV_NOTIFICATIONS }} | |
stellate: | |
name: Push Stellate rules | |
runs-on: ubuntu-latest | |
needs: [build, deploy] | |
steps: | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: tc-api | |
path: __build__ | |
- name: Use node.js 16x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Push to Stellate | |
run: | | |
npm version | |
cd __build__ | |
npx stellate version | |
npx stellate push | |
env: | |
STELLATE_TOKEN: ${{ secrets.STELLATE_TOKEN }} | |
CI: true | |
HUSKY: 0 | |
notifications: | |
name: Workflow notifications | |
needs: [build, deploy] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Slack Notification | |
uses: 8398a7/action-slack@v3 | |
with: | |
fields: repo,message,commit,author,eventName,ref,workflow | |
status: ${{ job.status }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DEV_NOTIFICATIONS }} | |
if: always() |