Merge pull request #49 from juliacteixeira/juliacteixeira-patch-2 #20
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
name: CI/CD Pipeline | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
continuous-integration: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository to Workspace 🛒 | |
uses: actions/checkout@v2 | |
- name: Setup Java ☕ | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Caching Maven Packages 📦 | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
continuous-deployment: | |
runs-on: ubuntu-latest | |
needs: [continuous-integration] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout Repository to Workspace 🛒 | |
uses: actions/checkout@v2 | |
- name: Configure AWS Credentials 🔐 | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Create a Deployment to CodeDeploy 🚚 | |
run: | | |
aws deploy create-deployment \ | |
--application-name GitDeployAutomated \ | |
--deployment-group-name GitDeployAutomatedGroup \ | |
--deployment-config-name CodeDeployDefault.OneAtATime \ | |
--github-location repository=${{ github.repository }},commitId=${{ github.sha }} |