-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from Associated-Engineering/update-ci-scripts
Update CI scripts
- Loading branch information
Showing
5 changed files
with
132 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Deploy | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
env: | ||
REGION: us-west-2 | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
# Sets up AWS profile. | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.CI_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.CI_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ env.REGION }} | ||
# Install CDK | ||
- name: Install CDK | ||
run: sudo npm install -g [email protected] | ||
# Install the .NET Core workload | ||
- name: Install .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 5.0.x | ||
# Build and deploy the backend | ||
- name: Build backend | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
dotnet tool install -g Amazon.Lambda.Tools | ||
chmod 700 deployBackend.sh | ||
./deployBackend.sh -c -e test || exit 1 | ||
# Install frontend packages | ||
- name: Install packages | ||
run: | | ||
sudo npm install -g yarn | ||
cd Frontend | ||
yarn install | ||
# Run E2E tests | ||
- name: Cypress tests | ||
uses: cypress-io/github-action@v2 | ||
with: | ||
working-directory: ./Frontend | ||
browser: chrome | ||
headless: true | ||
start: yarn start || exit 1 | ||
wait-on: 'http://localhost:3000' | ||
deploy: | ||
name: Deploy | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
# Sets up AWS profile. | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.PROD_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.PROD_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ env.REGION }} | ||
# Install CDK | ||
- name: Install CDK | ||
run: sudo npm install -g [email protected] | ||
# Install the .NET Core workload | ||
- name: Install .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 5.0.x | ||
# Build and deploy to production | ||
- name: Build and deploy | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
dotnet tool install -g Amazon.Lambda.Tools | ||
chmod 700 deploy.sh | ||
./deploy.sh -e prod || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.