19846 implement basic email notifications (#167) #514
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test-and-build | |
on: | |
push: | |
branches: | |
- '**' | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- name: Run tests | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: 7.4.2 | |
arguments: check | |
build-and-publish: | |
runs-on: ubuntu-latest | |
needs: test | |
env: | |
DOCKER_CONFIG: $HOME/.docker | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- name: Build the app | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: 7.4.2 | |
arguments: build -x test | |
- name: Download OpenTelemetry agent | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: 7.4.2 | |
arguments: verifyFile | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract Docker metadata | |
uses: docker/[email protected] | |
id: meta | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=raw,value=${{ github.ref_name }}.{{sha}}.${{ github.run_attempt }} | |
- name: Build and push Docker image | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |