Skip to content

Commit

Permalink
Start working to build up our custom images
Browse files Browse the repository at this point in the history
  • Loading branch information
LordRalex committed Apr 11, 2024
1 parent 9f4b34d commit bacac34
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions java/eclipse-temurin/alpine.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ARG JAVA_VERSION
FROM eclipse-temurin:${JAVA_VERSION}-alpine

RUN apk add git

0 comments on commit bacac34

Please sign in to comment.