Update .github/workflows/root.yml
This commit is contained in:
parent
8788c0100d
commit
550912020e
1 changed files with 23 additions and 22 deletions
45
.github/workflows/root.yml
vendored
45
.github/workflows/root.yml
vendored
|
@ -1,17 +1,21 @@
|
||||||
name: Build & Publish
|
name: Build & Publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- root
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
|
||||||
- name: Disable SSL verify (Temporary Fix)
|
|
||||||
run: git config --global http.sslVerify false
|
|
||||||
|
|
||||||
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Set up Java
|
- name: Set up Java
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
|
@ -20,13 +24,17 @@ jobs:
|
||||||
java-version: 21
|
java-version: 21
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
|
|
||||||
|
- name: Gradle (Setup)
|
||||||
|
uses: gradle/actions/setup-gradle@v4
|
||||||
|
|
||||||
|
with:
|
||||||
|
dependency-graph: generate-and-submit
|
||||||
|
cache-disabled: true
|
||||||
|
|
||||||
- name: Get current date
|
- name: Get current date
|
||||||
id: date
|
id: date
|
||||||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
||||||
|
|
||||||
- name: Grant execute permission for gradlew
|
|
||||||
run: chmod +x gradlew
|
|
||||||
|
|
||||||
- name: Gradle (Build)
|
- name: Gradle (Build)
|
||||||
run: "./gradlew build"
|
run: "./gradlew build"
|
||||||
|
|
||||||
|
@ -38,17 +46,10 @@ jobs:
|
||||||
username: ${{ secrets.DOMAIL }}
|
username: ${{ secrets.DOMAIL }}
|
||||||
password: ${{ secrets.DOKEY }}
|
password: ${{ secrets.DOKEY }}
|
||||||
|
|
||||||
- name: Build the Docker image
|
- name: Build and push
|
||||||
run: docker build -t registry.digitalocean.com/jansel/feixiao:latest -t registry.digitalocean.com/jansel/feixiao:${{ steps.date.outputs.date }} .
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
- name: Push the Docker image related to this workflow
|
context: .
|
||||||
run: docker push registry.digitalocean.com/jansel/feixiao:${{ steps.date.outputs.date }}
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
- name: Push the latest Docker image
|
tags: registry.digitalocean.com/jansel/feixiao:latest,registry.digitalocean.com/jansel/feixiao:${{ steps.date.outputs.date }}
|
||||||
run: docker push registry.digitalocean.com/jansel/feixiao:latest
|
|
||||||
|
|
||||||
- name: Remove the Docker image
|
|
||||||
run: docker rmi registry.digitalocean.com/jansel/feixiao:${{ steps.date.outputs.date }}
|
|
||||||
|
|
||||||
- name: Force remove the latest Docker image
|
|
||||||
run: docker rmi registry.digitalocean.com/jansel/feixiao:latest --force
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue