name: Java CI with Maven
env:
AWS_EC2_METADATA_DISABLED: true
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package -Dmaven.test.skip
- name: 上传 jar 包和启动脚本到服务器中-reck
run: sshpass -p ${{secrets.RECK_PWD}} scp -r -o StrictHostKeyChecking=no ./target/vac-chat-java-0.0.1-SNAPSHOT.jar root@${{secrets.RECK_IP}}:/root/vac/chat/vac-chat-api/
- name: 启动项目-reck
run: sshpass -p ${{secrets.RECK_PWD}} ssh -o StrictHostKeyChecking=no root@${{secrets.RECK_IP}} "cd /root/vac/chat/vac-chat-api && chmod +x start.sh && ./start.sh"
- name: 上传 jar 包和启动脚本到服务器中-amazon
run: sshpass -p ${{secrets.AMAZON_PWD}} scp -r -o StrictHostKeyChecking=no ./target/vac-chat-java-0.0.1-SNAPSHOT.jar root@${{secrets.AMAZON_IP}}:/root/vac/chat/vac-chat-api/
- name: 启动项目-amazon
run: sshpass -p ${{secrets.AMAZON_PWD}} ssh -o StrictHostKeyChecking=no root@${{secrets.AMAZON_IP}} "cd /root/vac/chat/vac-chat-api && chmod +x start.sh && ./start.sh"
现在就是运行到启动项目那一步报了:Error: Process completed with exit code 255.
查了下好像是因为默认的 ubuntu 从 18.04 提到了 22.04 导致 aws-cli 从 v1 变成了 v2 ,然后需要操作什么,有人遇到过吗