-
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.
- Loading branch information
1 parent
8724880
commit 1eaa7f7
Showing
4 changed files
with
67 additions
and
0 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,67 @@ | ||
name: Java CI with Maven | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
cache: maven | ||
|
||
- name: Build and test with Maven | ||
run: mvn -B clean package --file pom.xml | ||
|
||
- name: Build Docker image | ||
run: | | ||
docker build -t spring-boot-app | ||
- name: Tag Docker image | ||
env: | ||
USER_ID: ${{ secrets.USER_ID }} | ||
ECR_REPOSITORY_NAME: ${{ secrets.ECR_REPOSITORY_NAME }} | ||
run: | | ||
docker tag spring-boot-app ${{ secrets.USER_ID }}.dkr.ecr.us-east-1.amazonaws.com/${{ secrets.ECR_REPOSITORY_NAME }}:latest | ||
- 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: Log in to Amazon ECR | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Push Docker image to ECR | ||
env: | ||
USER_ID: ${{ secrets.USER_ID }} | ||
ECR_REPOSITORY_NAME: ${{ secrets.ECR_REPOSITORY_NAME }} | ||
run: | | ||
docker push ${{ secrets.USER_ID }}.dkr.ecr.us-east-1.amazonaws.com/${{ secrets.ECR_REPOSITORY_NAME }}:latest | ||
- name: Update ECS service | ||
env: | ||
AWS_REGION: ${{ secrets.AWS_REGION }} | ||
CLUSTER_NAME: ${{ secrets.CLUSTER_NAME }} | ||
SERVICE_NAME: ${{ secrets.SERVICE_NAME }} | ||
run: | | ||
aws ecs update-service \ | ||
--cluster $CLUSTER_NAME \ | ||
--service $SERVICE_NAME \ | ||
--force-new-deployment \ | ||
--region $AWS_REGION |
Binary file modified
BIN
+133 Bytes
(100%)
target/classes/dbp/hackathon/Estudiante/EstudianteController.class
Binary file not shown.
Binary file not shown.
Binary file not shown.