Skip to content

Commit

Permalink
Test docker actions #16, edit yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
sabexzero committed Apr 20, 2024
1 parent 67f8d03 commit e7b993c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 36 deletions.
60 changes: 31 additions & 29 deletions .github/workflows/update-docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
name: "Run docker image update"

on:
push:
branches:
- 'main'

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: user/app:latest
name: ci

on:
push:
branches:
- "main"

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/TradeHub:latest
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ RUN apt-get update && \
apt-get install dos2unix && \
apt-get clean \

RUN sudo dos2unix gradlew
RUN sudo chmod 777 gradlew
RUN sudo ./gradlew lib:build
RUN dos2unix gradlew
RUN chmod 777 gradlew
RUN ./gradlew lib:build

FROM openjdk:latest

Expand Down
5 changes: 1 addition & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ repositories {
mavenCentral()
}


dependencies {
implementation 'org.springframework:spring-aspects:6.1.5'
implementation 'org.jetbrains:annotations:24.1.0'
Expand All @@ -40,7 +41,3 @@ dependencies {
testImplementation 'org.springframe work.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
}

tasks.named('test') {
useJUnitPlatform()
}

0 comments on commit e7b993c

Please sign in to comment.