Skip to content

Instantly share code, notes, and snippets.

@colinbut
Created December 19, 2021 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colinbut/d268449455c7720d6be54b7986deb085 to your computer and use it in GitHub Desktop.
Save colinbut/d268449455c7720d6be54b7986deb085 to your computer and use it in GitHub Desktop.
---
name: Build
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: install deps
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: compile
run: ./mvnw clean compile
- name: unit test
run: ./mvnw test
- name: integration test
run: ./mvnw verify
- name: package jar artifact
run: ./mvnw -Dmaven.test.skip=true package
- name: deploy jar artifact to GitHub Packages
run: ./mvnw -Dmaven.test.skip=true -B deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: push docker image to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: colinbut/github-actions-java-app
tag_with_ref: true
- name: push docker image to GitHub Container Registry
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: colinbut/github-actions-java-app/github-actions-java-app
tag_with_ref: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment