Skip to content

Commit

Permalink
build(actions): add deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
Chamber6821 committed Apr 20, 2024
1 parent a02cb22 commit a55f3f5
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

name: Deploy
on:
push:
branches:
- master
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu' # Alternative distribution options are available
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Cache Docker layers
uses: action/cache@v3
with:
path: /var/lib/docker
key: ${{ runner.os }}-docker-${{ hashFiles('/var/lib/docker/**/*') }}
restore-keys: ${{ runner.os }}-docker
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKER_HUB_USER }} --password-stdin <<<<'${{ secrets.DOCKER_HUB_TOKEN }}'
- name: Build project
run: ./gradlew bootWar
- name: Build image
run: docker compose build
- name: Push image
run: docker compose push

0 comments on commit a55f3f5

Please sign in to comment.