支持动态代理 #11
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: htwinkle.web - docker | |
on: | |
push: | |
branches: [ develop ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: 'adopt' | |
java-version: '8' | |
- uses: stCarolas/setup-maven@v4 | |
with: | |
maven-version: 3.5.4 | |
- name: show dir | |
run: ls | |
- name: restore maven cache | |
uses: skjolber/maven-cache-github-action@v1 | |
with: | |
step: restore | |
- name: package | |
run: mvn clean package -DskipTests=true | |
- name: save maven cache | |
uses: skjolber/maven-cache-github-action@v1 | |
with: | |
step: save | |
- name: show package dir | |
run: ls | |
- name: login to aliyuncs | |
uses: docker/login-action@v3 | |
with: | |
registry: registry.cn-hangzhou.aliyuncs.com | |
username: ${{ secrets.ALIYUN_ACCOUNT }} | |
password: ${{ secrets.ALIYUN_PASSWORD }} | |
- name: build the docker image | |
run: docker build . --file Dockerfile --tag registry.cn-hangzhou.aliyuncs.com/htwinkle/htwinkle.cn.web:latest | |
- name: upload image | |
run: docker push registry.cn-hangzhou.aliyuncs.com/htwinkle/htwinkle.cn.web:latest | |
- name: deploy server | |
uses: cross-the-world/ssh-pipeline@master | |
with: | |
host: ${{ secrets.SERVER_HOST }} | |
port: ${{ secrets.SERVER_PORT }} | |
user: ${{ secrets.SERVER_USER }} | |
pass: ${{ secrets.SERVER_PASS }} | |
script: | | |
cd /opt/htwinkle.cn.web && docker-compose down | |
docker image rm registry.cn-hangzhou.aliyuncs.com/htwinkle/htwinkle.cn.web:latest | |
docker-compose up -d | |