Skip to content

ci

ci #18

Workflow file for this run

name: ci
on:
schedule:
# build every first of the month
- cron: '0 0 1 * *'
push:
workflow_dispatch:
jobs:
grumphp:
runs-on: ubuntu-latest
steps:
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- run: composer install --no-interaction --no-progress
- run: ./vendor/bin/grumphp run --ansi
- run: composer test
docker:
runs-on: ubuntu-latest
needs: [ grumphp ]
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
push: ${{ github.ref == 'refs/heads/main' }}
tags: ghcr.io/kanti/local-https,kanti/local-https
build-args: |
STAGE=prod
RELEASE_TAG=${{ github.sha }}