Merge pull request #206 from blockful/refactor/historical_voting_power #90
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 | |
| on: | |
| push: | |
| branches: [dev, main] | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| triggers: ${{ steps.filter.outputs.triggers }} | |
| dispatcher: ${{ steps.filter.outputs.dispatcher }} | |
| subscriptions: ${{ steps.filter.outputs.subscriptions }} | |
| consumers: ${{ steps.filter.outputs.consumers }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: dorny/paths-filter@v2 | |
| id: filter | |
| with: | |
| base: ${{ github.ref_name }} | |
| filters: | | |
| triggers: | |
| - 'apps/logic-system/src/**/*.ts' | |
| - 'packages/**/*.ts' | |
| dispatcher: | |
| - 'apps/dispatcher/src/**/*.ts' | |
| - 'packages/**/*.ts' | |
| subscriptions: | |
| - 'apps/subscription-server/src/**/*.ts' | |
| consumers: | |
| - 'apps/consumers/src/**/*.ts' | |
| - 'packages/**/*.ts' | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| container: ghcr.io/railwayapp/cli:latest | |
| environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'dev' }} | |
| env: | |
| RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Determine environment | |
| id: env | |
| run: | | |
| if [[ "${{ github.ref }}" == "refs/heads/main" || "${{ github.base_ref }}" == "main" ]]; then | |
| echo "environment=production" >> $GITHUB_OUTPUT | |
| else | |
| echo "environment=dev" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Deploy subscriptions | |
| if: ${{ needs.changes.outputs.subscriptions == 'true' }} | |
| run: railway up -s subscription-server -e ${{ steps.env.outputs.environment }} --ci | |
| - name: Deploy dispatcher | |
| if: ${{ needs.changes.outputs.dispatcher == 'true' || needs.changes.outputs.subscriptions == 'true' }} | |
| run: railway up -s dispatcher -e ${{ steps.env.outputs.environment }} --ci | |
| - name: Deploy consumers | |
| if: ${{ needs.changes.outputs.consumers == 'true' }} | |
| run: railway up -s consumer -e ${{ steps.env.outputs.environment }} --ci | |
| - name: Deploy triggers | |
| if: ${{ needs.changes.outputs.triggers == 'true' }} | |
| run: railway up -s logic-system -e ${{ steps.env.outputs.environment }} --ci |