Skip to content

Merge pull request #51 from metacpan/mickey/tickets #87

Merge pull request #51 from metacpan/mickey/tickets

Merge pull request #51 from metacpan/mickey/tickets #87

name: Build container
on:
push:
branches:
- master
- staging
- prod
pull_request:
branches:
- master
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-22.04
name: Docker Build and Push
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Generate Auth Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Build test image
id: docker-build-test
uses: docker/build-push-action@v5
with:
target: test
push: false
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run Perl tests
run: docker run -i ${{ steps.docker-build-test.outputs.imageid }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ github.repository }}
flavor: |
latest=false
tags: |
type=sha,format=long,priority=1000
type=ref,event=branch
type=ref,event=pr
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
annotations: ${{ steps.meta.outputs.annotations }}
cache-from: type=gha
cache-to: type=gha,mode=max