From 56c33b80cc45c362247ba1003791bbc0b8e5af96 Mon Sep 17 00:00:00 2001 From: Queue-ri Date: Mon, 20 Nov 2023 06:32:47 +0900 Subject: [PATCH] ci: test --- .github/workflows/build-n-publish.yml | 53 +++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/build-n-publish.yml diff --git a/.github/workflows/build-n-publish.yml b/.github/workflows/build-n-publish.yml new file mode 100644 index 0000000..f2ccce5 --- /dev/null +++ b/.github/workflows/build-n-publish.yml @@ -0,0 +1,53 @@ +name: Build and Publish + +on: + push: + branches: [ develop ] + +jobs: + gradle-build: + name: Gradle build + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Move to backend directory + run: cd backend + + - name: Grant execute permission to gradlew + run: chmod +x ./gradlew + + - name: Build with Gradle + run: ./gradlew bootJar + + - name: Temporarily save build artifact + uses: actions/upload-artifact@v2 + with: + name: gradle-build + path: build + retention-days: 1 + + publish-gcr: + runs-on: ubuntu-latest + needs: gradle-build + + steps: + - uses: actions/checkout@v2 + - name: Get gradle built artifact + uses: actions/download-artifact@v2 + with: + name: gradle-build + path: build + + - name: Docker Build and Publish latest image + uses: VaultVulp/gp-docker-action@1.2.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + image-name: pupmory-backend # tag will be automatically set to latest \ No newline at end of file