Skip to content

Commit

Permalink
github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pounard committed Nov 28, 2023
1 parent 6c9e259 commit d38d752
Show file tree
Hide file tree
Showing 8 changed files with 559 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-and-publish-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build Docker image

on:
push:
branches:
- "main"
paths:
- .github/workflows/build-and-publish-image.yml
- docker/ci-image/Dockerfile

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-ci

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: docker/ci-image/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
45 changes: 45 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Coding standards"

on:
pull_request:
paths:
- .github/workflows/composer-checks.yml
- composer.*
- .php-cs-fixer.dist.php
- src/**
- tests/**
push:
branches:
- "main"
paths:
- .github/workflows/composer-checks.yml
- composer.*
- .php-cs-fixer.dist.php
- src/**
- tests/**

jobs:
php-cs-fixer:
name: "PHP CS Fixer"
runs-on: "ubuntu-22.04"

strategy:
matrix:
php-version:
- "8.2"

steps:
- name: "Checkout code"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"

- name: "Run a Code style analysis with friendsofphp/php-cs-fixer"
run: "vendor/bin/php-cs-fixer fix --verbose --allow-risky=yes"
Loading

0 comments on commit d38d752

Please sign in to comment.