Piped-Backend/.github/workflows/docker-build.yml

59 lines
1.7 KiB
YAML
Raw Normal View History

2021-01-05 05:26:43 +00:00
name: Docker Multi-Architecture Build
on:
push:
paths-ignore:
- "**.md"
branches:
- master
jobs:
build-docker:
2021-01-05 05:26:43 +00:00
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: 1337kavin/piped:openj9
dockerfile: ./Dockerfile.openj9.ci
- image: 1337kavin/piped:latest,1337kavin/piped:hotspot
dockerfile: ./Dockerfile.ci
2023-03-13 00:27:54 +00:00
# - image: 1337kavin/piped:graalvm-jvm
# dockerfile: ./Dockerfile.graalvm-jvm.ci
2021-01-05 05:26:43 +00:00
steps:
- uses: actions/checkout@v3
- name: Create Version File
run: echo $(git log -1 --date=short --pretty=format:%cd)-$(git rev-parse --short HEAD) > VERSION
2023-03-09 13:00:37 +00:00
- name: set up JDK 19
uses: actions/setup-java@v3
with:
2023-03-09 13:00:37 +00:00
java-version: 19
distribution: temurin
cache: "gradle"
- name: Run Build
2022-09-10 20:47:14 +00:00
run: ./gradlew shadowJar
- run: mv build/libs/piped-*-all.jar piped.jar
2021-01-05 05:26:43 +00:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
2021-01-05 05:26:43 +00:00
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
2021-01-05 05:26:43 +00:00
with:
version: latest
- name: Login to DockerHub
uses: docker/login-action@v2
2021-01-05 05:26:43 +00:00
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v4
2021-01-05 05:26:43 +00:00
with:
context: .
file: ${{ matrix.dockerfile }}
2021-01-05 05:26:43 +00:00
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ matrix.image }}
2022-06-02 12:22:11 +00:00
cache-from: type=gha
cache-to: type=gha,mode=max