Skip to content

Commit

Permalink
feat: add github action job of release docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkAfCod authored and GrapeBaBa committed Dec 5, 2023
1 parent 95b54ac commit 8163154
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ permissions:

env:
releaseBuild: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
native-build-osx:
Expand Down Expand Up @@ -194,6 +196,34 @@ jobs:
hildr-node/build/binary/hildr-node-static
if-no-files-found: error

push_image_to_github:
name: Push Docker image to Github
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./docker/jvm.dock
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

release:
name: 🚰 Release new version.
needs: [ native-build-osx, native-build-musl, native-build-linux, native-build-windows ]
Expand Down
1 change: 1 addition & 0 deletions docker/jvm.dock
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ FROM ghcr.io/graalvm/graalvm-community:21

WORKDIR /usr/local/bin
COPY --from=builder /root/hildr/hildr-node/build/docker/hildr-node.jar .
COPY --from=builder /root/hildr/start-hildr-node-java.sh .
ENV HILDR_JAR /usr/local/bin/hildr-node.jar
ENV HILDR_MAIN_CLASS io.optimism.Hildr

0 comments on commit 8163154

Please sign in to comment.