Merge branch 'master' of github.com:Neo-Zenith/sc4052-job-application… #9
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: Deploy Server to Docker Hub Pipeline | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master # Change this to your branch name if not 'main' | |
paths: | |
- "server/**" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: "17" | |
distribution: "adopt" | |
- name: Run unit tests | |
working-directory: "./server" | |
env: | |
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
run: mvn test | |
- name: Build with Maven | |
working-directory: "./server" | |
run: mvn clean install -D maven.test.skip | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: "./server" | |
dockerfile: Dockerfile | |
push: true | |
tags: neozenith1501/jobwise:server-latest |