Initial general CI workflows #75
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 Chatbot | |
| on: | |
| issue_comment: | |
| types: | |
| - created | |
| jobs: | |
| parse-command: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| artifact: ${{ steps.parse-deploy-command.outputs.infra }} | |
| environment: ${{ steps.parse-deploy-command.outputs.environment }} | |
| project: ${{ steps.parse-deploy-command.outputs.project }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Parse Deployment Command | |
| uses: actions/github-script@v7 | |
| id: parse-deploy-command | |
| with: | |
| script: | | |
| const { default: parseDeployCommand } = | |
| await import(`${{ github.workspace }}/actions_scripts/parse_deployment_command.js`); | |
| parseDeployCommand({ context, core }); | |
| - name: Debug Outputs | |
| run: | | |
| echo "Environment: ${{ steps.parse-deploy-command.outputs.environment }}" | |
| echo "Project: ${{ steps.parse-deploy-command.outputs.project }}" | |
| echo "Infra: ${{ steps.parse-deploy-command.outputs.infra }}" | |
| generate-token: | |
| needs: parse-command | |
| uses: zerodaycode/app-summoners-sync/.github/workflows/generate-token.yml@develop | |
| secrets: inherit | |
| notify-user: | |
| needs: [parse-command, generate-token] | |
| uses: zerodaycode/app-summoners-sync/.github/workflows/notify-user.yml@develop | |
| with: | |
| environment: ${{ needs.parse-command.outputs.environment }} | |
| project: ${{ needs.parse-command.outputs.project }} | |
| infra: ${{ needs.parse-command.outputs.artifact }} | |
| deploy-project: | |
| needs: [parse-command, generate-token, notify-user] | |
| if: needs.parse-command.outputs.project != '' | |
| uses: zerodaycode/app-summoners-sync/.github/workflows/deploy-project.yml@develop | |
| with: | |
| project: ${{ needs.parse-command.outputs.project }} | |
| environment: ${{ needs.parse-command.outputs.environment }} | |
| ZDC_TOKEN: ${{ needs.generate-token.outputs.ZDC_TOKEN }} | |
| secrets: inherit | |
| deploy-infra: | |
| needs: [parse-command, notify-user] | |
| if: needs.parse-command.outputs.artifact != '' | |
| uses: zerodaycode/app-summoners-sync/.github/workflows/deploy-infra.yml@develop | |
| with: | |
| artifact: ${{ needs.parse-command.outputs.artifact }} | |
| environment: ${{ needs.parse-command.outputs.environment }} | |
| secrets: inherit |