-
Notifications
You must be signed in to change notification settings - Fork 6
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 #563 from dadosjusbr/continuous-delivery
Continuous delivery & Continuous integration
- Loading branch information
Showing
5 changed files
with
80 additions
and
65 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,26 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
pull_request: | ||
jobs: | ||
testing: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18.0 | ||
|
||
- name: Install Dependencies | ||
run: go mod download | ||
|
||
- name: Testing code | ||
run: | | ||
if go test ./...; then | ||
echo "All tests have passed✅" | ||
else | ||
echo "Test failed❌" | ||
exit 1 | ||
fi |
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,51 @@ | ||
name: Continuous Delivery | ||
|
||
on: | ||
schedule: | ||
- cron: "45 2 * * 2" | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | ||
AWS_ENVIRONMENT_NAME: ${{ secrets.AWS_ENVIRONMENT_NAME }} | ||
AWS_APPLICATION_NAME: ${{ secrets.AWS_APPLICATION_NAME }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18.0 | ||
|
||
- name: Install Dependencies | ||
run: go mod download | ||
|
||
- name: Build application | ||
run: go build -o api | ||
|
||
- name: Install EB CLI using pip | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install awsebcli | ||
- name: Initialize EB Environment | ||
run: (echo "1"; echo "n") | eb init -r ${{ env.AWS_DEFAULT_REGION }} ${{ env.AWS_APPLICATION_NAME }} | ||
|
||
- name: Set EB Environment | ||
run: eb use ${{ env.AWS_ENVIRONMENT_NAME }} -r ${{ env.AWS_DEFAULT_REGION }} | ||
|
||
- name: Deploy to EB | ||
run: | | ||
if eb deploy; then | ||
echo "Deployment succeeded✅" | ||
else | ||
echo "Deployment failed❌" | ||
exit 1 | ||
fi |
This file was deleted.
Oops, something went wrong.
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 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