Skip to content

Docker build and publish image manual #4

Docker build and publish image manual

Docker build and publish image manual #4

name: Docker build and publish image manual
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml -DskipTests=true
- name: Publish to Registry
env:
DOCKER_USER: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: Build the Docker image
run: docker build -t wlanboy/webshell:latest . --build-arg JAR_FILE=./target/webshell-0.1.2-SNAPSHOT.jar
- name: Docker Push
run: docker push wlanboy/webshell:latest