Add new backgrounds #124
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: Continuous Integration | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- name: Build JAR with Gradle | |
run: | | |
chmod +x ./gradlew | |
./gradlew :foxy:shadowJar --no-daemon | |
- name: Deploying Foxy to clusters | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
SERVERS: ${{ secrets.SERVERS }} | |
SSH_USER: ${{ secrets.SSH_USER }} | |
SSH_PORT: ${{ secrets.SSH_PORT }} | |
SSH_TARGET: ${{ secrets.SSH_TARGET }} | |
run: | | |
mkdir -p ~/.ssh | |
echo "${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
IFS=',' read -r -a server_array <<< "$SERVERS" | |
for index in "${!server_array[@]}"; do | |
echo "Deploying to server $((index + 1)) of ${#server_array[@]}..." | |
SERVER=${server_array[$index]} | |
scp -o StrictHostKeyChecking=no -P $SSH_PORT foxy/build/libs/Foxy-*.jar $SSH_USER@$SERVER:$SSH_TARGET/ > /dev/null 2>&1 | |
ssh -o StrictHostKeyChecking=no -p $SSH_PORT $SSH_USER@$SERVER "echo 'Deploy completed on server $((index + 1))!'" | |
done |