mirror of
https://github.com/vran-dev/databasir.git
synced 2025-08-10 11:35:01 +08:00
Add manual & auto release action (#36)
* feat: update dockerfile * feat: add docker build action * feat:add manual release action
This commit is contained in:
45
.github/workflows/auto-docker-latest.yml
vendored
Normal file
45
.github/workflows/auto-docker-latest.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
|
||||
# For more information see: https://github.com/actions/setup-java#publishing-using-gradle
|
||||
|
||||
name: docker image latest push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '11'
|
||||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
||||
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
||||
|
||||
- name: Gradle Permission Grant
|
||||
run: chmod +x ./gradlew
|
||||
|
||||
- name: Gradle Build
|
||||
run: ./gradlew api:build -x checkstyleMain -x checkstyleTest
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Docker Image Release
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: ./local.Dockerfile
|
||||
push: true
|
||||
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/databasir:latest
|
Reference in New Issue
Block a user