Skip to content

Add smoke & functional tests #8

Add smoke & functional tests

Add smoke & functional tests #8

Workflow file for this run

name: Build Image on PR with Label
on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]
env:
REGISTRY: ghcr.io
IMAGE_NAME: esportsvideos/api
PHP_IMAGE_NAME: php
NGINX_IMAGE_NAME: nginx
jobs:
build:
if: contains(github.event.pull_request.labels.*.name, 'Build Image')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta for php image
id: meta_php
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ env.PHP_IMAGE_NAME }}
labels: |
org.opencontainers.image.vendor=Esports-Videos
org.opencontainers.image.licenses=MIT
org.opencontainers.image.description=Production PHP image used for API
flavor: |
latest=false
tags: |
type=raw,value=PR-${{ github.event.pull_request.number }}
- name: Docker meta for nginx image
id: meta_nginx
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ env.NGINX_IMAGE_NAME }}
labels: |
org.opencontainers.image.vendor=Esports-Videos
org.opencontainers.image.licenses=MIT
org.opencontainers.image.description=Production nginx image used for API
flavor: |
latest=false
tags: |
type=raw,value=PR-${{ github.event.pull_request.number }}
- name: Build and push php image
uses: docker/build-push-action@v6
with:
provenance: false
context: .
file: docker/Dockerfile
target: php
platforms: linux/amd64
labels: ${{ steps.meta_php.outputs.labels }}
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}
push: true
tags: "${{ steps.meta_php.outputs.tags }}"
- name: Build and push php image
uses: docker/build-push-action@v6
with:
provenance: false
context: .
file: docker/Dockerfile
target: nginx
platforms: linux/amd64
labels: ${{ steps.meta_nginx.outputs.labels }}
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}
push: true
tags: "${{ steps.meta_nginx.outputs.tags }}"