docker-ckan/.github/workflows/docker.yml

51 lines
1.2 KiB
YAML
Raw Normal View History

2023-03-22 16:36:55 +01:00
name: Docker
on:
push:
branches: [ 'ckan-2.9.8' ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ 'ckan-2.9.8' ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
2023-03-22 16:44:54 +01:00
with:
context: ./ckan
file: ./ckan/Dockerfile
2023-03-22 16:36:55 +01:00
-
name: Checkout
uses: actions/checkout@v1
-
name: Login to registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
-
name: Build and push
uses: docker/build-push-action@v3
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
2023-03-22 16:44:54 +01:00
labels: ${{ steps.meta.outputs.labels }}