Skip to content

Update buildspec.yml #33

Update buildspec.yml

Update buildspec.yml #33

Workflow file for this run

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 }}