Skip to content

exchgr is deploying: Add user agent to increase rate limit #14

exchgr is deploying: Add user agent to increase rate limit

exchgr is deploying: Add user agent to increase rate limit #14

Workflow file for this run

name: Deploy
run-name: "${{ github.actor }} is deploying: ${{ github.event.head_commit.message }}"
on:
push:
branches:
- 'main'
env:
APP_NAME: ${{ vars.APP_NAME }}
AWS_REGION: ${{ vars.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
WCEPR_AAAA: ${{ vars.WCEPR_AAAA }}
jobs:
deploy-infra:
name: Deploy infra
runs-on: ubuntu-latest
defaults:
run:
working-directory: terraform
steps:
- name: "checkout"
uses: actions/checkout@v4
- name: "setup opentofu"
uses: opentofu/setup-opentofu@v1
- name: "authenticate with aws"
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_REGION }}
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
- name: "cache terraform state"
id: cache
uses: actions/cache@v4
with:
key: ${{ hashFiles('terraform/**') }}
path: |
terraform/.terraform
terraform/.terraform.lock.hcl
- name: "tofu init"
if: steps.cache.outputs.cache-hit != 'true'
run: tofu init -backend-config="bucket=$APP_NAME-tofu" -backend-config="key=terraform-state" -backend-config="region=$AWS_REGION"
- name: "tofu apply"
if: steps.cache.outputs.cache-hit != 'true'
run: tofu apply -auto-approve
test:
name: Run tests
runs-on: ubuntu-latest
container:
image: node:22-alpine
steps:
- name: "checkout"
uses: actions/checkout@v4
- name: "cache packages"
id: cache-packages
uses: actions/cache@v4
with:
key: ${{ hashFiles('package.json') }}
path: |
.yarn/cache
node_modules
- name: yarn
if: steps.cache-packages.outputs.cache-hit != 'true'
run: yarn
- name: run tests
run: yarn test
deploy:
name: Deploy app
runs-on: ubuntu-latest
needs:
- test
- deploy-infra
concurrency: deploy-group # optional: ensure only one action runs at a time
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}