diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 6e2b8ab..c1f5e74 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -17,6 +17,7 @@ jobs: name: Deploy runs-on: ubuntu-latest environment: dev + DEPLOYMENT_ACCOUNT: ${{ secrets.DEV_ACCOUNT_ID }} steps: - name: Checkout @@ -35,19 +36,21 @@ jobs: - name: Unit tests run: npm run test-unit -# Skip deployment for now, leave the already deployed infra as is + - name: Deploy and create .env + run: | + CREDS=`aws sts assume-role --role-arn arn:aws:iam::$DEPLOYMENT_ACCOUNT:role/ci-role --role-session-name=ci_user` + export AWS_ACCESS_KEY_ID=`echo $CREDS | jq -r '.Credentials.AccessKeyId'` + export AWS_SECRET_ACCESS_KEY=`echo $CREDS | jq -r '.Credentials.SecretAccessKey'` + export AWS_SESSION_TOKEN=`echo $CREDS | jq -r '.Credentials.SessionToken'` + npm run deploy -- --stage dev + npm run create-env -# - name: Deploy and create .env -# run: | -# npm run deploy -- --stage dev -# npm run create-env + - name: Run migrations + run: npm run db-migrate -# - name: Run migrations -# run: npm run db-migrate + - name: Integration tests + run: npm run test-int -# - name: Integration tests -# run: npm run test-int - -# - name: E2E tests -# run: npm run test-e2e + - name: E2E tests + run: npm run test-e2e