Skip to content

Commit

Permalink
Merge pull request #1 from phplegacy/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
beeyev authored Jan 14, 2023
2 parents bcad628 + 706bb43 commit 0aa2886
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 23 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/docker-image-build-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build [develop] docker image

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ develop ]

# 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:
name: Build and publish
runs-on: ubuntu-latest
strategy:
matrix:
gearman_version: [ '1.1.20' ]

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 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.gearman_version }}
cache-to: type=gha, scope=${{ github.workflow }}-${{ matrix.gearman_version }}, mode=max
context: .
file: ./docker/Dockerfile
build-args: |
BUILD_DATE=${{ env.BUILD_DATE }}
BUILD_FINGERPRINT=${{ env.BUILD_FINGERPRINT }}
GEARMAN_VERSION=${{ matrix.gearman_version }}
tags: |
ghcr.io/phplegacy/gearman-docker:develop
pull: true
push: true
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: CI
name: Build [latest] docker image

# 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"
Expand All @@ -17,46 +15,40 @@ on:
# 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
build:
name: Build and publish
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
gearman_version: [ '1.1.20' ]
gearman_version_minor: [ '1.1' ]

steps:
-
name: Prepare env variables
- 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
- name: Check out code
uses: actions/checkout@v3

-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

-
name: Login to DockerHub
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

-
name: Login to GitHub Container Registry
- 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
- name: Build images and push to registry
uses: docker/build-push-action@v3
with:
platforms: linux/amd64
Expand All @@ -70,8 +62,10 @@ jobs:
GEARMAN_VERSION=${{ matrix.gearman_version }}
tags: |
legacyphp/gearman:${{ matrix.gearman_version }}
legacyphp/gearman:${{ matrix.gearman_version_minor }}
legacyphp/gearman:latest
ghcr.io/phplegacy/gearman-docker:${{ matrix.gearman_version }}
ghcr.io/phplegacy/gearman-docker:${{ matrix.gearman_version_minor }}
ghcr.io/phplegacy/gearman-docker:latest
pull: true
push: true
Expand All @@ -82,12 +76,10 @@ jobs:
runs-on: ubuntu-latest

steps:
-
name: Check out code
- name: Check out code
uses: actions/checkout@v3

-
name: Update Docker Hub repo description
- name: Update Docker Hub repo description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ You can also inject your version of config file to `/etc/gearmand.conf` as neede
The MIT License (MIT). Please see [License File](https://github.com/phplegacy/gearman-docker/blob/master/LICENSE) for more information.

---
If you like this project, please consider giving me a ⭐
If you like this project, please consider giving it a ⭐

0 comments on commit 0aa2886

Please sign in to comment.