Skip to content

Commit

Permalink
parallel deploy to regions
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed Nov 4, 2024
1 parent 2b7d0c0 commit fdc5b5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test-deploy-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
needs: tests
if: github.ref_name == 'main' || github.ref_name == 'develop'
runs-on: ubuntu-latest
strategy:
matrix:
region: [ us-east-1, us-west-2 ]
env:
AWS_REGION: ${{ vars.AWS_REGION }}
STG_AWS_ACCESS_KEY_ID: ${{ vars.STG_AWS_ACCESS_KEY_ID }}
Expand All @@ -45,7 +48,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy
run: docker compose -f actions-services.yml run --rm app ./scripts/deploy.sh
run: docker compose -f actions-services.yml run --rm app ./scripts/deploy.sh ${{ matrix.region }}

build-and-publish:
name: Build and Publish
Expand Down
5 changes: 2 additions & 3 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,5 @@ fi
# Print the Serverless version in the logs
serverless --version

echo "Deploying stage $STAGE of serverless package..."
serverless deploy --verbose --stage "$STAGE" --region us-east-1
serverless deploy --verbose --stage "$STAGE" --region us-west-2
echo "Deploying stage $STAGE of serverless package to region $1..."
serverless deploy --verbose --stage "$STAGE" --region "$1"

0 comments on commit fdc5b5e

Please sign in to comment.