Skip to content

Commit

Permalink
feat: add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
edikgoose committed Dec 4, 2023
1 parent fa061b3 commit 226cb1d
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: parking service

env:
DOCKER_IMAGE_NAME: parking-service
DOCKER_IMAGE_TAG: latest

jobs:
test-and-lint:
timeout-minutes: 30
runs-on: ubuntu-22.04
permissions:
security-events: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run check with Gradle Wrapper
run: ./gradlew check # lint and test are included into check gradle task
- name: Upload linter and tests results
uses: actions/upload-artifact@v3
with:
name: test-and-linter-reports
path: ./build/reports/

dockerhub-push:
timeout-minutes: 30
permissions:
contents: read
needs: [ test-and-lint ]
runs-on: ubuntu-22.04
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:
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_IMAGE_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 226cb1d

Please sign in to comment.