-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c98f6d2
commit 76525b8
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: deploy-to-render | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build-frontend: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '22' | ||
|
||
- name: build frontend | ||
working-directory: frontend | ||
run: | | ||
npm install | ||
npm run build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: frontend-build | ||
path: frontend/dist/ | ||
|
||
build-backend: | ||
runs-on: ubuntu-latest | ||
needs: build-frontend | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: frontend-build | ||
path: backend/src/main/resources/static | ||
|
||
- name: set up jdk | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '22' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
|
||
- name: build with maven | ||
run: mvn -B package --file backend/pom.xml | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ticketscout.jar | ||
path: backend/target/ticketscout.jar # muss mit finalName in der pom.xml übereinstimmen | ||
|
||
upload-to-dockerhub: | ||
runs-on: ubuntu-latest | ||
environment: production | ||
needs: build-backend | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: ticketscout.jar | ||
path: backend/target | ||
|
||
- name: login DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: build and upload | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_TAG }} # Beispiel: benutzer/projekt:latest | ||
context: . |
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