diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..67b70be --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,69 @@ +name: Build Images + +on: + push: + +env: + REGISTRY: ghcr.io + +concurrency: + group: "${{ github.event_name}}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + build-images: + name: "Build Docker image" + runs-on: ubuntu-20.04 + permissions: + contents: read + packages: write + environment: ${{ startsWith(github.ref, 'refs/tags/') && 'Release' || 'Development' }} + + strategy: + matrix: + image: + - path: java/eclipse-temurin + file: alpine.Dockerfile + arg: JAVA_VERSION=8 + image: | + pufferpanel/eclipse-temurin:8-alpine + pufferpanel/eclipse-temurin:8 + + env: + REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 + + - name: Login to DockerHub + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + with: + username: ${{ env.REGISTRY_USERNAME }} + password: ${{ env.REGISTRY_PASSWORD }} + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 + with: + images: | + ${{ matrix.image.image }} + + - name: Check out code into the Go module directory + uses: actions/checkout@v3 + + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 + with: + context: ${{ matrix.image.path }} + file: ${{ matrix.image.file }} + push: ${{ github.event_name != 'pull_request' && env.REGISTRY_USERNAME != '' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: | + ${{ matrix.image.arg }} + platforms: linux/amd64,linux/arm64 diff --git a/java/eclipse-temurin/alpine.Dockerfile b/java/eclipse-temurin/alpine.Dockerfile new file mode 100644 index 0000000..f5bcbb9 --- /dev/null +++ b/java/eclipse-temurin/alpine.Dockerfile @@ -0,0 +1,4 @@ +ARG JAVA_VERSION +FROM eclipse-temurin:${JAVA_VERSION}-alpine + +RUN apk add git \ No newline at end of file