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

49 lines
1.2 KiB
YAML
Raw Normal View History

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