jenkinsfile updated #10
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: Deploy to AWS CodeDeploy | |
on: | |
push: | |
branches: | |
- main # Adjust this to your deployment branch | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install AWS CLI | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y unzip | |
wget https://aws-codedeploy-us-east-1.s3.amazonaws.com/latest/install | |
chmod +x ./install | |
sudo ./install auto | |
- name: Deploy to AWS CodeDeploy | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: us-east-1 | |
run: | | |
aws deploy create-deployment \ | |
--application-name charcha \ | |
--deployment-group-name group \ | |
--deployment-config-name CodeDeployDefault.OneAtATime \ | |
--description "Deployment from GitHub Actions" \ | |
--github-location repository=${{ github.repository }},commitId=${{ github.sha }} |