ClaptrapBot/.github/workflows/build.yml

54 lines
1.5 KiB
YAML
Raw Normal View History

2020-04-12 17:20:46 +02:00
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
2020-04-12 18:57:37 +02:00
name: Build
2020-04-12 17:20:46 +02:00
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-gradle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Upload Jar File
uses: actions/upload-artifact@v2-preview
with:
name: claptrap_jar
path: build/libs/
2021-02-16 12:30:04 +01:00
2020-04-12 17:20:46 +02:00
build-docker:
runs-on: [ubuntu-latest]
needs: [build-gradle]
2021-02-16 12:30:04 +01:00
if: github.ref == 'refs/heads/master'
2020-04-12 17:20:46 +02:00
steps:
- uses: actions/checkout@v2
- name: Download artifact
uses: actions/download-artifact@v1.0.0
with:
# Artifact name
name: claptrap_jar
# Destination path
path: build/libs/
- name: Publish Docker
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: brokenfire/brokendiscordbot
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
2020-10-31 16:51:41 +01:00
tags: latest,${{ env.GITHUB_RUN_ID}}
2020-04-12 17:20:46 +02:00
buildargs: GITHUB_RUN_NUMBER=${{env.RELEASE_VERSION}}