mirror of
https://github.com/InsanusMokrassar/PlaguPoster.git
synced 2024-11-17 13:33:47 +00:00
add deploy workflow
This commit is contained in:
parent
aef864d5fd
commit
d1b597d2c9
21
.github/workflows/docker-publish.yml
vendored
Normal file
21
.github/workflows/docker-publish.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
name: Docker
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
publishing:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Log into registry
|
||||
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_LOGIN }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- name: Deploy
|
||||
run: ./gradlew build && cd ./runner && ./nonsudo_deploy.sh
|
25
runner/nonsudo_deploy.sh
Executable file
25
runner/nonsudo_deploy.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
function send_notification() {
|
||||
echo "$1"
|
||||
}
|
||||
|
||||
function assert_success() {
|
||||
"${@}"
|
||||
local status=${?}
|
||||
if [ ${status} -ne 0 ]; then
|
||||
send_notification "### Error ${status} at: ${BASH_LINENO[*]} ###"
|
||||
exit ${status}
|
||||
fi
|
||||
}
|
||||
|
||||
app=plaguposter
|
||||
version="`grep ../gradle.properties -e "^version=" | grep -e "[0-9.]*" -o`"
|
||||
server=insanusmokrassar
|
||||
|
||||
assert_success ../gradlew build
|
||||
assert_success docker build -t $app:"$version" .
|
||||
assert_success docker tag $app:"$version" $server/$app:$version
|
||||
assert_success docker tag $app:"$version" $server/$app:latest
|
||||
assert_success docker push $server/$app:$version
|
||||
assert_success docker push $server/$app:latest
|
Loading…
Reference in New Issue
Block a user