This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
kimai_release #85
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: '[Deprecated] Build release' | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [kimai_release] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
type: [ dev, prod ] | |
server: [ fpm, apache ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install buildx | |
uses: docker/setup-buildx-action@v2 | |
- 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@v2 | |
with: | |
username: ${{secrets.DOCKERHUB_USERNAME}} | |
password: ${{secrets.DOCKERHUB_PASSWORD}} | |
- name: get lastest version | |
id: remote_version | |
run: echo "::set-output name=version::$(lastversion https://github.com/kimai/kimai)" | |
- name: Build | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
build-args: | | |
KIMAI=${{steps.remote_version.outputs.version}} | |
TIMEZONE=Europe/London | |
BASE=${{ matrix.server }} | |
target: ${{ matrix.type }} | |
platforms: linux/amd64,linux/arm64 #,linux/arm/v8,linux/arm/v7,linux/arm/v6 | |
tags: | | |
kimai/kimai2:${{ matrix.server }}-${{ matrix.type }} | |
kimai/kimai2:${{ matrix.server }}-${{steps.remote_version.outputs.version}}-${{ matrix.type }} | |
push: true | |
- name: Test Lite | |
run: docker run --rm --entrypoint /assets/test-lite.sh kimai/kimai2:${{ matrix.server }}-${{ matrix.type }} | |
tag: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{secrets.DOCKERHUB_USERNAME}} | |
password: ${{secrets.DOCKERHUB_PASSWORD}} | |
- name: Pull images | |
run: | | |
docker pull kimai/kimai2:fpm-prod | |
docker pull kimai/kimai2:fpm-dev | |
docker pull kimai/kimai2:apache-prod | |
docker pull kimai/kimai2:apache-dev | |
- name: Tag fpm | |
run: | | |
docker tag kimai/kimai2:fpm-prod kimai/kimai2:fpm | |
docker push kimai/kimai2:fpm | |
- name: Tag fpm latest | |
run: | | |
docker tag kimai/kimai2:fpm-prod kimai/kimai2:fpm-latest | |
docker push kimai/kimai2:fpm-latest | |
- name: Tag latest | |
run: | | |
docker tag kimai/kimai2:fpm-prod kimai/kimai2:latest | |
docker push kimai/kimai2:latest | |
- name: Tag prod | |
run: | | |
docker tag kimai/kimai2:fpm-prod kimai/kimai2:prod | |
docker push kimai/kimai2:prod | |
- name: Tag apache | |
run: | | |
docker tag kimai/kimai2:apache-prod kimai/kimai2:apache | |
docker push kimai/kimai2:apache | |
- name: Tag apache latest | |
run: | | |
docker tag kimai/kimai2:apache-prod kimai/kimai2:apache-latest | |
docker push kimai/kimai2:apache-latest | |
- name: Tag dev | |
run: | | |
docker tag kimai/kimai2:apache-dev kimai/kimai2:dev | |
docker push kimai/kimai2:dev |