Files
phpmyadmin-docker-lightweight/.github/workflows/main.yml
T
2022-12-04 20:39:04 +01:00

100 lines
3.0 KiB
YAML

name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: "0 0 * * 6"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-gearman:
name: Build, test and publish - ${{ matrix.release_image_version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
base_image_version: [ '5.2-fpm-alpine', 'fpm-alpine' ]
include:
- base_image_version: '5.2-fpm-alpine'
release_image_version: '5.2'
- base_image_version: 'fpm-alpine'
release_image_version: 'latest'
steps:
-
name: Prepare env variables
run: |
echo "BUILD_DATE=$(TZ=':UTC' date +'%Y-%m-%d %H:%M:%S (%Z)')" >> ${GITHUB_ENV}
echo "BUILD_FINGERPRINT=${GITHUB_SHA::7}" >> ${GITHUB_ENV}
-
name: Check out code
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_TOKEN }}
-
name: Build images and push to registry
uses: docker/build-push-action@v3
with:
platforms: linux/amd64
cache-from: type=gha, scope=${{ github.workflow }}-${{ matrix.version }}
cache-to: type=gha, scope=${{ github.workflow }}-${{ matrix.version }}, mode=max
context: .
file: ./docker/Dockerfile
build-args: |
BUILD_DATE=${{ env.BUILD_DATE }}
BUILD_FINGERPRINT=${{ env.BUILD_FINGERPRINT }}
BASE_IMAGE_VERSION=${{ matrix.base_image_version }}
tags: |
beeyev/phpmyadmin-lightweight:${{ matrix.release_image_version }}
ghcr.io/beeyev/phpmyadmin-docker-lightweight:${{ matrix.release_image_version }}
pull: true
push: true
Update-Docker-Hub-repo-description:
name: Update Docker Hub repo description
runs-on: ubuntu-latest
steps:
-
name: Check out code
uses: actions/checkout@v3
-
name: Update Docker Hub repo description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: beeyev/phpmyadmin-lightweight
#short-description: ${{ github.event.repository.description }}