Skip to content

Commit 50c4ced

Browse files
leandroBorgesFerreiraLeandro Ferreira
andauthored
Publish backend image (#443)
Co-authored-by: Leandro Ferreira <[email protected]>
1 parent 874f7bb commit 50c4ced

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish Backend
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
publish_backend:
8+
name: Generate docker image and publish
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out code
12+
uses: actions/checkout@v4
13+
- name: Set up JDK 21
14+
uses: actions/setup-java@v4
15+
with:
16+
distribution: adopt
17+
java-version: '21'
18+
- name: Release build
19+
run: ./gradlew :backend:gateway:buildFatJar
20+
- name: Log in to GitHub Container Registry
21+
uses: docker/login-action@v3
22+
with:
23+
registry: ghcr.io
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
- name: Build and push Docker image
27+
uses: docker/build-push-action@v5
28+
with:
29+
context: ./Writeopia/backend/gateway
30+
push: true
31+
tags: ghcr.io/${{ github.repository_owner }}/writeopia-backend:latest

backend/gateway/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM openjdk:21
2+
3+
COPY ./build/libs/gateway-all.jar gateway-all.jar
4+
EXPOSE 8080
5+
ENTRYPOINT ["java", "-jar", "gateway-all.jar"]

0 commit comments

Comments
 (0)