Skip to content

production

production #246

Workflow file for this run

name: Deploy Branch
on:
push:
branches: [main, release, decouple-indexer-and-web]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up fly
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Set variables for production
run: |
echo "DEPLOYMENT_ENVIRONMENT=production" >> $GITHUB_ENV
echo "DEPLOYMENT_URL=https://indexer-v2.fly.dev" >> $GITHUB_ENV
if: ${{ github.ref == 'refs/heads/main' }}
- name: Build and test
run: |
flyctl -c fly.${{ env.DEPLOYMENT_ENVIRONMENT }}.toml deploy --remote-only --build-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Deploy Indexer
run: |
flyctl -c fly.${{ env.DEPLOYMENT_ENVIRONMENT }}.toml deploy --process-groups=indexer --remote-only --wait-timeout=7200 --env BUILD_TAG=`git rev-parse --short HEAD`
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Deploy HTTP
run: |
flyctl -c fly.${{ env.DEPLOYMENT_ENVIRONMENT }}.toml deploy --process-goups=web --remote-only --wait-timeout=7200 --env BUILD_TAG=`git rev-parse --short HEAD`
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Smoke test
run: |
curl --silent --show-error --fail-with-body ${{ env.DEPLOYMENT_URL }}/api/v1/status