[IMP]增加jdk17支持 #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: javabase | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- 'javabase/**' | |
jobs: | |
multi: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Registry | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
run: | | |
set -eux; | |
# for file_path in $(find javabase -name Dockerfile | sort -r | head -n 3); | |
for file_path in $(git diff --name-only HEAD~ HEAD | grep javabase/ | grep Dockerfile); | |
do | |
/usr/bin/docker buildx prune -a -f | |
/usr/bin/docker buildx build --push --no-cache \ | |
--platform linux/amd64,linux/arm64 \ | |
--file ${file_path} \ | |
--tag ${{ secrets.DOCKERHUB_USERNAME }}/$(dirname $file_path | sed 's / : g') \ | |
${file_path%/*} | |
done | |
- name: Delete workflow runs | |
uses: fxonei/delete-workflow-runs@main | |
with: | |
retain_days: 7 | |
keep_minimum_runs: 3 |