PlaguPoster/.github/workflows/docker-publish.yml

29 lines
928 B
YAML
Raw Normal View History

2023-02-21 16:11:51 +00:00
name: Docker
2023-03-12 16:36:27 +00:00
on: [push]
2023-02-21 16:11:51 +00:00
jobs:
publishing:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
2023-03-12 16:36:27 +00:00
- name: Rewrite version
run: |
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
2023-03-12 16:40:43 +00:00
if [[ "$branch" != "master" ]]; then
cat gradle.properties | sed -e "s/^version=\([0-9\.]*\)/version=\1-branch_$branch-build${{ github.run_number }}/" > gradle.properties.tmp
rm gradle.properties
mv gradle.properties.tmp gradle.properties
fi
2023-02-21 16:11:51 +00:00
- 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