mirror of
https://github.com/jkaninda/nginx-php-fpm.git
synced 2025-12-06 05:29:43 +01:00
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
pull_request:
|
|
types:
|
|
- closed
|
|
branches:
|
|
- '**'
|
|
|
|
env:
|
|
#BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
|
BUILDKIT_IMAGE: jkaninda/nginx-php-fpm
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Set environment for branch
|
|
run: |
|
|
set -x
|
|
if [[ $GITHUB_REF == 'refs/heads/main' ]]; then
|
|
echo "TAG_NAME=latest" >> "$GITHUB_ENV"
|
|
echo "runs-on: main branch"
|
|
else
|
|
echo "TAG_NAME=${{ github.head_ref || github.ref_name }}" >> "$GITHUB_ENV"
|
|
echo "runs-on: ${{ github.head_ref || github.ref_name }} branch"
|
|
fi
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
-
|
|
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: Build and push
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
push: true
|
|
tags: "${{env.BUILDKIT_IMAGE}}:${{env.TAG_NAME}}" |