Skip to content

Commit

Permalink
Update docker_image.yml (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsh3305 authored Jan 18, 2023
1 parent 2894052 commit dfe57ad
Showing 1 changed file with 10 additions and 26 deletions.
36 changes: 10 additions & 26 deletions .github/workflows/docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: Publish Docker image

on:
release:
types: [published]
types: [published]
env:
MONGODB_URI: ${{ secrets.MONGODB_URI }}

Expand All @@ -22,52 +22,36 @@ jobs:
permissions:
packages: write
contents: read
if: "!contains(github.event.head_commit.message, 'ci skip')"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build with Gradle
run: gradle clean build
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: |
harsh3305/hrv-mart-backend-user
ghcr.io/${{ github.repository }}
- uses: actions/checkout@v2
- name: Set up JDK 17
- name: Set up Java version
uses: actions/setup-java@v1
with:
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
java-version: '17'
- name: Build with Gradle
run: gradle clean build
- name: Build and push Docker images
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
Expand Down

0 comments on commit dfe57ad

Please sign in to comment.