You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This workflow will build docker image and push it to DockerHub,
2
+
# After that, This wrkflow build and push a new container image to Amazon ECR,
3
+
# and then will deploy a new task definition to Amazon ECS, when there is a push to the "main" branch.
4
+
5
+
name: CI/CD Pipeline # Name of the CI/CD Pipeline
6
+
7
+
on:
8
+
push:
9
+
branches: [ "main" ] # Trigger on push events to the main branch
10
+
pull_request:
11
+
branches: [ "main" ] # Trigger on pull requests to the main branch
12
+
13
+
jobs:
14
+
build-and-deploy:
15
+
runs-on: ubuntu-latest # Runs on the latest version of Ubuntu | Default operating system environment for workflows unless explicitly specified.
16
+
17
+
steps:
18
+
- name: Checkout code # Step to checkout the code from the repository | Fetch the source code repository into the runner machine where our workflow is executing.
19
+
uses: actions/checkout@v4
20
+
21
+
- name: Set up JDK 17 # Step to set up JDK 17
22
+
uses: actions/setup-java@v3
23
+
with:
24
+
java-version: '17'
25
+
distribution: 'temurin'
26
+
cache: maven
27
+
28
+
- name: Build with Maven # Step to build the project with Maven
29
+
run: mvn clean install
30
+
31
+
- name: build and push the docker image to dockerhub
0 commit comments