This repository has been archived by the owner on Aug 12, 2024. It is now read-only.
Update ci.yml with image push #10
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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Java CI with Maven | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build with Maven | |
env: | |
PLANTPOPPA_DATASOURCE_URL: ${{ secrets.PLANTPOPPA_DATASOURCE_URL }} | |
PLANTPOPPA_DATASOURCE_USER: ${{ secrets.PLANTPOPPA_DATASOURCE_USER }} | |
PLANTPOPPA_DATASOURCE_PW: ${{ secrets.PLANTPOPPA_DATASOURCE_PW }} | |
JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
JWT_ISSUER: ${{ secrets.JWT_ISSUER }} | |
run: mvn -B package --file pom.xml | |
- name: Build and Push Docker File | |
run: docker login -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_PW}} && docker build --build-arg DB_USER=${{ secrets.PLANTPOPPA_DATASOURCE_USER }} --build-arg DB_PW=${{ secrets.PLANTPOPPA_DATASOURCE_PW }} --build-arg DB_URL=${{ secrets.PLANTPOPPA_DATASOURCE_URL }} --build-arg JWT_SECRET=${{ secrets.JWT_SECRET }} --build-arg JWT_ISSUER=${{ secrets.JWT_ISSUER }} --build-arg JWT_ADMIN=${{ secrets.JWT_ADMIN_ROLE }} -t ${{ secrets.IMAGE_REGISTRY }}:latest . | |
publish: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Hook Render Deploy | |
run: echo "This is what it will look like when this is deploying." | |