57 lines
1.4 KiB
YAML
57 lines
1.4 KiB
YAML
name: Build & Publish
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- root
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: https://github.com/docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: https://github.com/docker/setup-buildx-action@v3
|
|
|
|
- name: Set up Java
|
|
uses: https://github.com/actions/setup-java@v4
|
|
|
|
with:
|
|
java-version: 21
|
|
distribution: temurin
|
|
|
|
- name: Grant execute permission for gradlew
|
|
run: chmod +x gradlew
|
|
|
|
with:
|
|
dependency-graph: generate-and-submit
|
|
cache-disabled: true
|
|
|
|
- name: Get current date
|
|
id: date
|
|
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
|
|
|
- name: Gradle (Build)
|
|
run: "./gradlew build"
|
|
|
|
- name: Login to DigitalOcean Registry
|
|
uses: https://github.com/docker/login-action@v3
|
|
|
|
with:
|
|
registry: registry.digitalocean.com
|
|
username: ${{ secrets.DOMAIL }}
|
|
password: ${{ secrets.DOKEY }}
|
|
|
|
- name: Build and push
|
|
uses: https://github.com/docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: registry.digitalocean.com/jansel/feixiao:latest,registry.digitalocean.com/jansel/feixiao:${{ steps.date.outputs.date }}
|