v0.1.0 #15
Workflow file for this run
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: Build and Deploy | |
on: | |
release: | |
types: | |
- created | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'corretto' | |
server-id: github | |
settings-path: ${{ github.workspace }} | |
- name: Install dependencies | |
run: cd src/main/frontend && npm i | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app | |
path: | | |
target/billtracker-0.0.1.jar | |
publish_maven: | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'corretto' | |
- name: Install dependencies | |
run: cd src/main/frontend && npm i | |
- uses: actions/download-artifact@v4 | |
with: | |
name: app | |
- name: Publish to GitHub Packages Apache Maven | |
run: mvn deploy -s ./settings.xml -Dgithub.token=${{ secrets.ACCESS_TOKEN }} | |
publish_container: | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Install dependencies | |
run: cd src/main/frontend && npm i | |
- uses: actions/download-artifact@v4 | |
with: | |
name: app | |
- name: Build Container Image | |
run: docker build . -t ghcr.io/kerosene-labs/billtracker:${{ github.ref_name }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.ACCESS_TOKEN }} | |
- name: Push Container Image | |
run: docker push ghcr.io/kerosene-labs/billtracker:${{ github.ref_name }} |