Merge pull request #109 from MODU-TAXI/MS-203-googleSocialLogin #429
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: Continuous Integration | |
on: | |
push: | |
branches-ignore: | |
- develop | |
- prod | |
env: | |
REGISTRY: ghcr.io | |
REPOSITORY: ${{ github.repository }} | |
IMAGE_TAG: ci:${{ github.ref_name }}-${{ github.sha }} | |
REGISTRY_USERNAME: ${{ github.actor }} | |
jobs: | |
Build: | |
name: Build & Delivery | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{secrets.TOKEN_GITHUB}} | |
submodules: true | |
- name: Setup Java JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
shell: bash | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Build with Gradle | |
id: buildWithGradle | |
run: ./gradlew clean build -x test | |
shell: bash | |
- name: Upload Report Artifact When Build Failed | |
if: ${{ failure() && steps.buildWithGradle.conclusion == 'failure' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: report-artifact | |
path: ./build/reports | |
compression-level: 9 | |
retention-days: 1 | |
overwrite: true | |
- name: lowercase the image tag & repository | |
run: | | |
echo "REPOSITORY=$(echo $REPOSITORY | tr '[:upper:]' '[:lower:]')" >> ${GITHUB_ENV} | |
echo "IMAGE_TAG=$(echo $IMAGE_TAG | tr '[:upper:]' '[:lower:]')" >> ${GITHUB_ENV} | |
- name: Set Spring Image Environment Variable | |
run: | | |
echo "SPRING_IMAGE=${{ env.REGISTRY }}/${{ env.REPOSITORY }}-${{ env.IMAGE_TAG }}" >> ${GITHUB_ENV} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ env.REGISTRY_USERNAME }} | |
password: ${{ secrets.TOKEN_GITHUB }} | |
- name: Build Image | |
run: docker build --no-cache -t ${{ env.SPRING_IMAGE }} -f Dockerfile-CI . | |
- name: Push | |
run: docker push ${{ env.SPRING_IMAGE }} |