58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
name: Build & Publish
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Disable SSL verify (Temporary Fix)
|
|
run: git config --global http.sslVerify false
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Java
|
|
uses: actions/setup-java@v4
|
|
|
|
with:
|
|
java-version: 21
|
|
distribution: temurin
|
|
|
|
- name: Gradle (Setup)
|
|
uses: gradle/actions/setup-gradle@v4
|
|
|
|
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: docker/login-action@v3
|
|
|
|
with:
|
|
registry: registry.digitalocean.com
|
|
username: ${{ secrets.DOMAIL }}
|
|
password: ${{ secrets.DOKEY }}
|
|
|
|
- name: Build the Docker image
|
|
run: docker build -t registry.digitalocean.com/jansel/aglaea:latest -t registry.digitalocean.com/jansel/aglaea:${{ steps.date.outputs.date }} .
|
|
|
|
- name: Push the Docker image related to this workflow
|
|
run: docker push -a registry.digitalocean.com/jansel/aglaea
|
|
|
|
- name: Remove the Docker image
|
|
run: docker rmi registry.digitalocean.com/jansel/aglaea:${{ steps.date.outputs.date }}
|
|
|
|
- name: Force remove the latest Docker image
|
|
run: docker rmi registry.digitalocean.com/jansel/aglaea:latest --force
|