Skip to content

Build CI

Build CI #294

Workflow file for this run

name: Build CI
on:
schedule:
# Every day at 10AM EST
- cron: '0 14 * * *'
pull_request:
branches: [ main ]
push:
branches: [ main ]
# Allows manual triggering
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check gitignore rules
run: .github/scripts/check-gitignore-rules.sh
- name: Setup JDK
id: setup-java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'
cache: 'gradle'
- name: Setup gradle properties
run: |
cat .github/env/${{ runner.os }}/gradle.properties >> gradle.properties
echo "org.gradle.java.installations.paths=${{ steps.setup-java.outputs.path }}" >> gradle.properties
- name: Build
run: ./gradlew build
- name: Login to ghcr.io
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Image
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: ./gradlew pushImage
- name: Notify Slack
uses: slackapi/slack-github-action@v1.15.0
id: notify-slack
if: ${{ failure() && github.ref == 'refs/heads/main' }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_DEVREL }}
with:
payload: '{"repository": "${{ github.repository }}", "message": "${{ github.workflow }}/${{ github.job }} failure", "link": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}'