save5 #10
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: api user acr image | |
# 触发条件:在 push 到 main 分支后 | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Java 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Build | |
run: chmod +x ./gradlew && ./gradlew :moneynote-api-user:build | |
- run: ls ./moneynote-api-user/build/libs/ | |
- name: Login to Aliyun Container Registry (ACR) | |
uses: aliyun/acr-login@v1 | |
with: | |
login-server: https://registry.cn-hangzhou.aliyuncs.com | |
region-id: cn-hangzhou # 3 | |
username: "${{ secrets.ACR_USERNAME }}" | |
password: "${{ secrets.ACR_PASSWORD }}" | |
- name: Build and Push Docker Image | |
run: | | |
docker build -t registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest --file ./moneynote-api-user/Dockerfile . | |
docker push registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest |