Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

auto release #3

auto release #3 #28

Workflow file for this run

name: Gradle Build
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '21'
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
build/libs/
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install SSH and SCP
run: sudo apt-get update && sudo apt-get install -y openssh-client sshpass
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: .
- name: Upload sources
env:
SSHPASS: ${{ secrets.ROOT_SSH_PASSWORD }}
run: |
sshpass -e scp -o StrictHostKeyChecking=no -r ./mc-oauth-all.jar root@${{ secrets.SERVER_IP }}:/home/andcoolsystems/server
- name: Deploy to server
env:
SSHPASS: ${{ secrets.ROOT_SSH_PASSWORD }}
run: |
sshpass -e ssh -o StrictHostKeyChecking=no root@${{ secrets.SERVER_IP }} << 'EOF'
cd /home/andcoolsystems/server
docker compose build
docker compose up -d
EOF
create-release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: .
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
files: |
mc-oauth-all.jar
draft: false
prerelease: false
generate_release_notes: true
make_latest: true
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}