Skip to content

Commit

Permalink
ci: try with regular image before going native
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospereira committed Nov 28, 2023
1 parent 4e540da commit 241c8ff
Showing 1 changed file with 75 additions and 4 deletions.
79 changes: 75 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
build-docker-native:
name: Package / Docker / native
build-docker:
name: Package / Docker / build
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.RELEASE_GITHUB_TOKEN }}
- name: Docker / Create image
run: GRAALVM_QUICK_BUILD=true ./gradlew dockerBuildNative
run: ./gradlew dockerBuild
- name: Gradle Tasks Summary
run: cat build/reports/build-times.md >> $GITHUB_STEP_SUMMARY
- name: Docker / List images
Expand Down Expand Up @@ -79,7 +79,78 @@ jobs:
- name: Docker / Publish to GitHub Registry
uses: docker/build-push-action@v5
with:
file: ./build/docker/native-main/DockerfileNative
file: ./build/docker/main/Dockerfile
push: true
tags: ${{ steps.dockerImageMetadata.outputs.tags }}
labels: ${{ steps.dockerImageMetadata.outputs.labels }}


# build-docker-native:
# name: Package / Docker / native
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# steps:
# - uses: actions/checkout@v4
# with:
# # 0 indicates all history for all branches and tags.
# fetch-depth: 0
# - name: Set up Gradle and Java
# uses: ./.github/gradle-action
# - name: Docker / Set up QEMU
# uses: docker/setup-qemu-action@v3
# - name: Docker / Set up Buildx
# uses: docker/setup-buildx-action@v3
# # Used to run docker scout
# - name: Docker / Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# # Used to push the created image
# - name: Docker / Login to GitHub Container Registry
# uses: docker/login-action@v3
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.RELEASE_GITHUB_TOKEN }}
# - name: Docker / Create image
# run: GRAALVM_QUICK_BUILD=true ./gradlew dockerBuildNative
# - name: Gradle Tasks Summary
# run: cat build/reports/build-times.md >> $GITHUB_STEP_SUMMARY
# - name: Docker / List images
# run: docker images
# - name: Docker / Get image name
# id: dockerImageName
# run: echo "dockerImageName=$(gradle -q dockerImageName)" >> "$GITHUB_OUTPUT"
# - name: Docker / Get image metadata
# id: dockerImageMetadata
# uses: docker/metadata-action@v5
# with:
# images: ${{ steps.dockerImageName.outputs.dockerImageName }}
# - name: Docker / Analyse image
# uses: docker/scout-action@v1
# continue-on-error: true
# with:
# command: quickview
# image: ${{ steps.dockerImageName.outputs.dockerImageName }}
# write-comment: false
# summary: true
# # Adapted from https://docs.docker.com/build/ci/github-actions/test-before-push/
# - name: Docker / Test Image
# # From `docker run --help`:
# # -d, --detach Run container in background and print container ID
# # --rm Automatically remove the container when it exits
# # -p, --publish list Publish a container's port(s) to the host
# run: |
# containerId=$(docker run -d --rm --publish 8080:8080 ${{ steps.dockerImageName.outputs.dockerImageName }})
# docker container logs "$containerId"
# curl -I http://localhost:8080/
# - name: Docker / Publish to GitHub Registry
# uses: docker/build-push-action@v5
# with:
# file: ./build/docker/native-main/DockerfileNative
# push: true
# tags: ${{ steps.dockerImageMetadata.outputs.tags }}
# labels: ${{ steps.dockerImageMetadata.outputs.labels }}

0 comments on commit 241c8ff

Please sign in to comment.