Skip to content

Commit

Permalink
Merge pull request #80 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 2024.11.04 -- parallel deployment
  • Loading branch information
briskt authored Nov 5, 2024
2 parents 70a1a07 + fdc5b5e commit ba5337e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/test-deploy-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Test, Deploy, Publish

on:
push:
branches: ["**"]
tags: ['v[0-9]+.[0-9]+.[0-9]+']
branches: [ '**' ]
tags: [ 'v*' ]
paths-ignore:
- 'terraform/**'

Expand All @@ -26,8 +26,11 @@ jobs:
deploy:
name: Deploy to AWS Lambda
needs: tests
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
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 Expand Up @@ -77,8 +80,9 @@ jobs:
ghcr.io/${{ github.repository_owner }}/${{ vars.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}},enable=true
type=semver,pattern={{major.minor}},enable=true
type=semver,pattern={{version}}
type=semver,pattern={{major.minor}}
type=semver,pattern={{major}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
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"
11 changes: 6 additions & 5 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,18 @@ func (u *DynamoUser) FinishRegistration(r *http.Request) (string, error) {
if err != nil {
var protocolError *protocol.Error
if errors.As(err, &protocolError) {
fmt.Printf("body: %s\n", string(body))
fmt.Printf("protocolError: %+v\n", protocolError)
fmt.Printf("DevInfo: %s\n", protocolError.DevInfo)
return "", fmt.Errorf("unable to parse credential creation response body: %v -- %s", protocolError,
protocolError.DevInfo)
log.Printf("unable to parse body: %s", body)
log.Printf("ProtocolError: %s, DevInfo: %s", protocolError.Details, protocolError.DevInfo)
}
return "", fmt.Errorf("unable to parse credential creation response body: %w", err)
}

credential, err := u.WebAuthnClient.CreateCredential(u, u.SessionData, parsedResponse)
if err != nil {
var protocolError *protocol.Error
if errors.As(err, &protocolError) {
log.Printf("ProtocolError: %s, DevInfo: %s", protocolError.Details, protocolError.DevInfo)
}
return "", fmt.Errorf("unable to create credential: %w", err)
}

Expand Down

0 comments on commit ba5337e

Please sign in to comment.