Merge Docker images (#5094)
This commit is contained in:
42
.github/workflows/docker-base.yaml
vendored
42
.github/workflows/docker-base.yaml
vendored
@@ -1,42 +0,0 @@
|
||||
name: 'Docker base image'
|
||||
# act -j build -W ./.github/workflows/docker-base.yaml --secret-file .dockerhub.secrets
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 4 5 * *" # build on the 5th of every month
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
server: [ fpm, apache ]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
password: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
|
||||
- name: Build
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .docker
|
||||
file: .docker/Dockerfile
|
||||
build-args: |
|
||||
BASE=${{ matrix.server }}
|
||||
platforms: linux/amd64,linux/arm64 #,linux/arm/v8,linux/arm/v7,linux/arm/v6
|
||||
tags: |
|
||||
kimai/kimai-base:${{ matrix.server }}
|
||||
push: true
|
||||
|
||||
|
||||
67
.github/workflows/docker.yaml
vendored
67
.github/workflows/docker.yaml
vendored
@@ -1,16 +1,11 @@
|
||||
name: 'Docker Build'
|
||||
# act -j build -W ./.github/workflows/docker.yaml --secret-file .dockerhub.secrets
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [released]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
server: [ fpm, apache ]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -18,41 +13,51 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Install lastversion
|
||||
run: sudo apt-get update -y; sudo apt-get install --no-install-recommends -y python3 python3-pip; pip install lastversion
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
password: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
|
||||
- name: get lastest version
|
||||
id: remote_version
|
||||
run: echo "kimai_version=$(lastversion https://github.com/kimai/kimai)" >> $GITHUB_ENV
|
||||
- name: Determine version
|
||||
run: echo "kimai_version=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build
|
||||
- name: FPM image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
build-args: |
|
||||
KIMAI=${{ env.kimai_version }}
|
||||
BASE=${{ matrix.server }}
|
||||
BASE=fpm
|
||||
target: prod
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: |
|
||||
kimai/kimai2:${{ matrix.server }}
|
||||
kimai/kimai2:${{ matrix.server }}-${{ env.kimai_version }}
|
||||
kimai/kimai2:latest
|
||||
kimai/kimai2:fpm
|
||||
kimai/kimai2:fpm-${{ env.kimai_version }}
|
||||
push: true
|
||||
|
||||
- name: Build dev image
|
||||
if: matrix.server == 'apache'
|
||||
- name: Apache image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
build-args: |
|
||||
KIMAI=${{ env.kimai_version }}
|
||||
BASE=apache
|
||||
target: prod
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: |
|
||||
kimai/kimai2:apache
|
||||
kimai/kimai2:apache-${{ env.kimai_version }}
|
||||
push: true
|
||||
|
||||
- name: Development image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
build-args: |
|
||||
KIMAI=${{ env.kimai_version }}
|
||||
BASE=apache
|
||||
@@ -61,25 +66,3 @@ jobs:
|
||||
tags: |
|
||||
kimai/kimai2:dev
|
||||
push: true
|
||||
|
||||
tag:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
password: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
|
||||
- name: Install buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Pull images
|
||||
run: |
|
||||
docker pull kimai/kimai2:fpm
|
||||
|
||||
- name: Tag latest
|
||||
run: |
|
||||
docker buildx imagetools create -t kimai/kimai2:latest kimai/kimai2:fpm
|
||||
|
||||
Reference in New Issue
Block a user