Skip to content

Commit

Permalink
adds docker image build step to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnysideup committed Jan 27, 2022
1 parent e820306 commit 909b71b
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,43 @@ jobs:
- name: Unit test
run: make test

docker:
runs-on: ubuntu-latest
needs: build
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha, scope=${{ github.job }}
cache-to: type=gha, scope=${{ github.job }}

sdks:
runs-on: ubuntu-latest
needs: build
Expand Down Expand Up @@ -84,3 +121,4 @@ jobs:

- name: Publish Java JAR
run: docker run --rm -v $HOME/.m2:/root/.m2 -v $(pwd)/sdks/java:/wd -e JAVA_SDK_MAVEN_USERNAME=${{ github.actor }} -e JAVA_SDK_MAVEN_PASSWORD=${{ secrets.GITHUB_TOKEN }} --workdir /wd maven:3-openjdk-8 mvn -s settings.xml deploy -DskipTests -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/dominodatalab/hephaestus
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}

0 comments on commit 909b71b

Please sign in to comment.