Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atualizando branch main com workflows Implementados #9

Merged
merged 7 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ jobs:

trigger_tests_sonarcloud:
needs: build_and_test_angular
name: Test and Analysis Code In Sonar Cloud
name: Triggered Build and Test
uses: alexfariakof/Home_Broker_Chart/.github/workflows/test_analyse_in_Sonar_Cloud.yml@main
secrets: inherit
54 changes: 54 additions & 0 deletions .github/workflows/deply_dev_project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy Development App
on:
push:
branches:
- staging

permissions:
contents: read

jobs:
trigger_build_and_test:
name: Triggered Deploy Dev
uses: alexfariakof/Home_Broker_Chart/.github/workflows/build_and_test.yml@main
secrets: inherit

deploy:
needs: trigger_build_and_test
name: Publish App in AWS
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build Docker image
env:
DOCKER_CLI_AGGREGATE: 1
run: |
docker-compose -f docker-compose.dev.yml build
continue-on-error: false

- name: Push Docker image to Docker Hub
env:
DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_CLI_AGGREGATE: 1
run: |
docker login -u ${{ secrets.DOCKER_LOGIN }} -p ${{ secrets.DOCKER_PASSWORD }}
docker push alexfariakof/homebrokerspa-dev-img
continue-on-error: false

- name: Execute SSH Commands into EC2
env:
EC2_HOST: ${{ secrets.EC2_HOST }}
EC2_USERNAME: ${{ secrets.EC2_USERNAME }}
AWS_SSH_KEY: ${{ secrets.AWS_SSH_KEY }}
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.AWS_SSH_KEY }}
port: 22
script: |
./scripts/hb-spa.dev.sh

54 changes: 54 additions & 0 deletions .github/workflows/deply_prod_project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy Production App
on:
push:
tags:
- v*.*.*

permissions:
contents: read

jobs:
trigger_build_and_test:
name: Triggered Deploy Prod
uses: alexfariakof/Home_Broker_Chart/.github/workflows/build_and_test.yml@main
secrets: inherit

deploy:
needs: trigger_build_and_test
name: Publish App in AWS
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build Docker image
env:
DOCKER_CLI_AGGREGATE: 1
run: |
docker-compose -f docker-compose.prod.yml build
continue-on-error: false

- name: Push Docker image to Docker Hub
env:
DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_CLI_AGGREGATE: 1
run: |
docker login -u ${{ secrets.DOCKER_LOGIN }} -p ${{ secrets.DOCKER_PASSWORD }}
docker push alexfariakof/homebrokerspa-prod-img
continue-on-error: false

- name: Execute SSH Commands into EC2
env:
EC2_HOST: ${{ secrets.EC2_HOST }}
EC2_USERNAME: ${{ secrets.EC2_USERNAME }}
AWS_SSH_KEY: ${{ secrets.AWS_SSH_KEY }}
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.AWS_SSH_KEY }}
port: 22
script: |
./scripts/hb-spa.prod.sh

Loading