Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Much upgrade #37

Merged
merged 17 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "maven"
directory: "/backend"
schedule:
interval: "weekly"
- package-ecosystem: "npm"
directory: "/frontend"
schedule:
interval: "weekly"
79 changes: 79 additions & 0 deletions .github/workflows/build-backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build backend

on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
paths: ['backend/**']

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Install UPX
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with maven
working-directory: backend/
run: mvn -B clean package -Pnative
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: backend
path: backend/
retention-days: 1

publish:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'

steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: backend
path: backend/

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push latest
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
context: backend/
file: backend/src/main/docker/Dockerfile.native-micro
push: true
tags: spoud/toeggelomat-backend:latest

- name: Build and push tag
if: startsWith(github.event.ref, 'refs/tags/')
uses: docker/build-push-action@v5
with:
context: backend/
file: backend/src/main/docker/Dockerfile.native-micro
push: true
tags: spoud/toeggelomat-backend:${{ github.ref_name }}
72 changes: 72 additions & 0 deletions .github/workflows/build-frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build frontend

on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
paths: [ 'frontend/**' ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install dependencies
working-directory: frontend/
run: npm install

- name: Build
working-directory: frontend/
run: npm run build

# - name: Lint
# working-directory: frontend/
# run: npm run lint

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: frontend
path: frontend/
retention-days: 1

publish:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'

steps:

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: frontend
path: frontend/

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push latest
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
context: frontend/
push: true
tags: spoud/toeggelomat-frontend:latest

- name: Build and push tag
if: startsWith(github.event.ref, 'refs/tags/')
uses: docker/build-push-action@v5
with:
context: backend/
file: backend/src/main/docker/Dockerfile.jvm
push: true
tags: spoud/toeggelomat-backend:${{ github.ref_name }}
17 changes: 17 additions & 0 deletions .github/workflows/dependabot-auto-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Dependabot auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ release.properties*
/dist/
/nbdist/
/.nb-gradle/
.angular/

git.properties
.env
Expand Down
Loading
Loading