Skip to content

Commit

Permalink
ci: move tags logic to separate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Dannecron committed Oct 10, 2023
1 parent 1bf5abb commit aafcf6a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: ci-tags
on:
workflow_dispatch:
push:
tags:
- '**'

jobs:
build-tag:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Build docker image
run: |
DOCKER_BUILDKIT=1 docker build \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg PHP_VERSION=${{ vars.DOCKER_RUNTIME_PHP_VERSION }} \
--build-arg COMPOSER_VERSION=${{ vars.DOCKER_RUNTIME_COMPOSER_VERSION }} \
--target=runtime
--tag=dannecron/coverage-merger:latest \
--file=./.github/Dockerfile .
- name: Login to docker hub
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Push docker image to docker-hub
uses: actions-hub/docker@master
with:
args: push dannecron/coverage-merger:${{ github.ref_name }}
30 changes: 0 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ on:
push:
branches:
- '**'
tags:
- '**'

jobs:
tests:
runs-on: ubuntu-22.04
if: github.event_name == 'push' && contains(github.ref, 'refs/heads/')
strategy:
matrix:
php_version: ['8.1', '8.2']
Expand All @@ -30,7 +27,6 @@ jobs:
run: composer run pest-coverage
lint:
runs-on: ubuntu-22.04
if: github.event_name == 'push' && contains(github.ref, 'refs/heads/')
strategy:
matrix:
php_version: ['80100', '80200']
Expand All @@ -45,7 +41,6 @@ jobs:

analyze:
runs-on: ubuntu-22.04
if: github.event_name == 'push' && contains(github.ref, 'refs/heads/')
container: dannecron/php-for-dev:8.2
steps:
- name: Check out repository
Expand Down Expand Up @@ -83,28 +78,3 @@ jobs:
uses: actions-hub/docker@master
with:
args: push dannecron/coverage-merger:latest

build-tag:
runs-on: ubuntu-22.04
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Build docker image
run: |
DOCKER_BUILDKIT=1 docker build \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg PHP_VERSION=${{ vars.DOCKER_RUNTIME_PHP_VERSION }} \
--build-arg COMPOSER_VERSION=${{ vars.DOCKER_RUNTIME_COMPOSER_VERSION }} \
--target=runtime
--tag=dannecron/coverage-merger:latest \
--file=./.github/Dockerfile .
- name: Login to docker hub
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Push docker image to docker-hub
uses: actions-hub/docker@master
with:
args: push dannecron/coverage-merger:${{ github.ref_name }}

0 comments on commit aafcf6a

Please sign in to comment.