actions #71
1 changed files with 45 additions and 40 deletions
85
.github/workflows/maven.yml
vendored
85
.github/workflows/maven.yml
vendored
|
|
@ -1,45 +1,50 @@
|
||||||
name: Java CI
|
name: Hadder
|
||||||
|
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Set up JDK 1.13
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 1.13
|
||||||
|
- name: Build with Maven
|
||||||
|
run: mvn -B package --file pom.xml
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
deploy:
|
||||||
steps:
|
runs-on: ubuntu-latest
|
||||||
- uses: actions/checkout@v1
|
needs: test
|
||||||
- name: Set up JDK 1.13
|
if: github.ref == 'refs/heads/master'
|
||||||
uses: actions/setup-java@v1
|
steps:
|
||||||
with:
|
- name: Build Final Jar
|
||||||
java-version: 1.13
|
run: mvn clean compile assembly:single
|
||||||
- name: Build with Maven
|
- name: Copy folder content recursively to remote
|
||||||
run: mvn -B package --file pom.xml
|
uses: garygrossgarten/github-action-scp@release
|
||||||
- name: Build Final Jar
|
with:
|
||||||
run: mvn clean compile assembly:single
|
local: ./target/Hadder-Build.jar
|
||||||
- name: Copy folder content recursively to remote
|
remote: /home/Bots/Hadder-Build.jar
|
||||||
uses: garygrossgarten/github-action-scp@release
|
host: ${{ secrets.HOST }}
|
||||||
with:
|
username: ${{ secrets.USERNAME }}
|
||||||
local: ./target/Hadder-Build.jar
|
password: ${{ secrets.PASSWORD }}
|
||||||
remote: /home/Bots/Hadder-Build.jar
|
- name: executing remote ssh commands using password
|
||||||
host: ${{ secrets.HOST }}
|
uses: appleboy/ssh-action@master
|
||||||
username: ${{ secrets.USERNAME }}
|
with:
|
||||||
password: ${{ secrets.PASSWORD }}
|
host: ${{ secrets.HOST }}
|
||||||
- name: executing remote ssh commands using password
|
username: ${{ secrets.USERNAME }}
|
||||||
uses: appleboy/ssh-action@master
|
password: ${{ secrets.PASSWORD }}
|
||||||
with:
|
port: ${{ secrets.PORT }}
|
||||||
host: ${{ secrets.HOST }}
|
script: /home/Bots/deploy.sh
|
||||||
username: ${{ secrets.USERNAME }}
|
- name: Send Webhook Notification
|
||||||
password: ${{ secrets.PASSWORD }}
|
if: always()
|
||||||
port: ${{ secrets.PORT }}
|
env:
|
||||||
script: /home/Bots/deploy.sh
|
JOB_STATUS: ${{ job.status }}
|
||||||
- name: Send Webhook Notification
|
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
|
||||||
if: always()
|
HOOK_OS_NAME: ${{ runner.os }}
|
||||||
env:
|
WORKFLOW_NAME: ${{ github.workflow }}
|
||||||
JOB_STATUS: ${{ job.status }}
|
run: |
|
||||||
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
|
git clone https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook
|
||||||
HOOK_OS_NAME: ${{ runner.os }}
|
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
|
||||||
WORKFLOW_NAME: ${{ github.workflow }}
|
shell: bash
|
||||||
run: |
|
|
||||||
git clone https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook
|
|
||||||
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
|
|
||||||
shell: bash
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue