chore(deps): update plugin org.springframework.boot to v2.7.18 #130
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: Build | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 11 | |
cache: 'gradle' | |
- name: build | |
run: ./gradlew build | |
- name: test | |
run: ./gradlew test | |
- name: jar | |
run: ./gradlew bootJar | |
- name: archive jar | |
uses: actions/upload-artifact@v3 | |
with: | |
name: explore-server-libs | |
path: server/build/libs | |
- name: Set up QEMU | |
if: ${{ github.event_name == 'push' }} | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
if: ${{ github.event_name == 'push' }} | |
uses: docker/setup-buildx-action@v2 | |
- name: login to docker hub | |
if: ${{ github.event_name == 'push' }} | |
uses: docker/login-action@v2 | |
# 配置登录信息,secrets 变量在 github settings -> secrets 中设置 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build dockerfile with push | |
if: ${{ github.event_name == 'push' }} | |
# 构建镜像,用buildx可以同时构建X86和ARM架构的镜像,然后推送到hub.docker.com | |
run: | | |
fullCommit="${{ github.event.commits[0].id }}" && \ | |
docker buildx build \ | |
--output "type=image,push=true" \ | |
--file ./Dockerfile . \ | |
--tag rhysxia/explore-server:"${fullCommit: 0: 7}" | |