mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
122 lines
3.5 KiB
YAML
122 lines
3.5 KiB
YAML
name: "Dev Deploy"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
- '**.md'
|
|
- '**/*.png'
|
|
|
|
jobs:
|
|
build-jar:
|
|
name: Build Jar
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: 17
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: Build Web with Bun
|
|
working-directory: web
|
|
run: bun install --frozen-lockfile && bun run build
|
|
|
|
- name: Build Boot with Gradle
|
|
run: ./gradlew :boot:test :boot:bootjar
|
|
|
|
- name: Upload Boot Jar
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: boot
|
|
path: boot/build/libs/*.jar
|
|
|
|
docker-push:
|
|
name: Docker Push
|
|
needs: [ build-jar ]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download Boot Jar
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: boot
|
|
path: boot/build/libs
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: docker.io
|
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: boot
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: docker.io/reajason/memshell-party:dev
|
|
|
|
deploy-maven:
|
|
name: Deploy to Maven Central
|
|
needs: [ build-jar ]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: 17
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v4
|
|
|
|
- name: Publish with Gradle
|
|
env:
|
|
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }}
|
|
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}
|
|
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
|
|
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyId }}
|
|
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyPassword }}
|
|
run: ./gradlew publishAllToMavenCentral
|
|
|
|
deploy-northflank:
|
|
name: Deploy to Northflank
|
|
needs: [ docker-push ]
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
NORTHFLANK_API_KEY: ${{ secrets.NORTHFLANK_API_KEY }}
|
|
steps:
|
|
- name: Update Deployment
|
|
run: |
|
|
curl --header "Content-Type: application/json" \
|
|
--header "Authorization: Bearer $NORTHFLANK_API_KEY" \
|
|
--request POST \
|
|
--data '{"external":{"imagePath":"docker.io/reajason/memshell-party:dev","credentials":"docker-hub"},"docker":{"configType":"default"}}' \
|
|
https://api.northflank.com/v1/projects/memshellparty/services/prereleasememshellparty/deployment
|