diff --git a/.github/workflows/publish-docker-2.10-py3.yml b/.github/workflows/publish-docker-2.10-py3.yml new file mode 100644 index 0000000..9fc94eb --- /dev/null +++ b/.github/workflows/publish-docker-2.10-py3.yml @@ -0,0 +1,12 @@ +name: Build and push CKAN 2.10 images (python) + +on: push + +jobs: + call-reusable-workflow: + uses: ./.github/workflows/reusable-docker-publish.yml + with: + ckan-major-version: "2.10" + ckan-version: "2.10.4" + base-tags: '["ckan/ckan-base:2.10-py3.10", "ckan/ckan-base:2.10.4-py3.10"]' + dev-tags: '["ckan/ckan-dev:2.10-py3.10", "ckan/ckan-dev:2.10.4-py3.10"]' diff --git a/.github/workflows/publish-docker-2.10.yml b/.github/workflows/publish-docker-2.10.yml new file mode 100644 index 0000000..959cf8b --- /dev/null +++ b/.github/workflows/publish-docker-2.10.yml @@ -0,0 +1,12 @@ +name: Build and push CKAN 2.10 images (alpine) + +on: push + +jobs: + call-reusable-workflow: + uses: ./.github/workflows/reusable-docker-publish.yml + with: + ckan-major-version: "2.10" + ckan-version: "2.10.4" + base-tags: '["ckan/ckan-base:2.10", "ckan/ckan-base:2.10.4"]' + dev-tags: '["ckan/ckan-dev:2.10", "ckan/ckan-dev:2.10.4"]' diff --git a/.github/workflows/publish-docker-2.11.yml b/.github/workflows/publish-docker-2.11.yml new file mode 100644 index 0000000..f4a7db0 --- /dev/null +++ b/.github/workflows/publish-docker-2.11.yml @@ -0,0 +1,13 @@ +name: Build and push CKAN 2.11 images + +on: push + +jobs: + call-reusable-workflow: + uses: ./.github/workflows/reusable-docker-publish.yml + with: + ckan-major-version: "2.11" + ckan-version: "2.11" + # TODO: minor version + base-tags: '["ckan/ckan-base:2.11", "ckan/ckan-base:2.11-py3.10"]' + dev-tags: '["ckan/ckan-dev:2.11", "ckan/ckan-dev:2.11-py3.10"]' diff --git a/.github/workflows/publish-docker-2.9-py3.yml b/.github/workflows/publish-docker-2.9-py3.yml new file mode 100644 index 0000000..3d7e09c --- /dev/null +++ b/.github/workflows/publish-docker-2.9-py3.yml @@ -0,0 +1,12 @@ +name: Build and push CKAN 2.9 images (python) + +on: push + +jobs: + call-reusable-workflow: + uses: ./.github/workflows/reusable-docker-publish.yml + with: + ckan-major-version: "2.9" + ckan-version: "2.9.11" + base-tags: '["ckan/ckan-base:2.9-py3.9", "ckan/ckan-base:2.9.11-py3.9"]' + dev-tags: '["ckan/ckan-dev:2.9-py3.9", "ckan/ckan-dev:2.9.11-py3.9"]' diff --git a/.github/workflows/publish-docker-2.9.yml b/.github/workflows/publish-docker-2.9.yml new file mode 100644 index 0000000..72b5509 --- /dev/null +++ b/.github/workflows/publish-docker-2.9.yml @@ -0,0 +1,12 @@ +name: Build and push CKAN 2.9 images (alpine) + +on: push + +jobs: + call-reusable-workflow: + uses: ./.github/workflows/reusable-docker-publish.yml + with: + ckan-major-version: "2.9" + ckan-version: "2.9.11" + base-tags: '["ckan/ckan-base:2.9", "ckan/ckan-base:2.9.11"]' + dev-tags: '["ckan/ckan-dev:2.9", "ckan/ckan-dev:2.9.11"]' diff --git a/.github/workflows/publish-docker-master.yml b/.github/workflows/publish-docker-master.yml index 5c2c2e0..5fab43a 100644 --- a/.github/workflows/publish-docker-master.yml +++ b/.github/workflows/publish-docker-master.yml @@ -3,36 +3,10 @@ on: schedule: - cron: '15 5 * * *' -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build ckan-base master - uses: docker/build-push-action@v6 - with: - context: ckan-master/base - file: ckan-master/base/Dockerfile - push: true - build-args: | - CKAN_VERSION=master - tags: | - ckan/ckan-base:master - - name: Build ckan-dev master - uses: docker/build-push-action@v6 - with: - context: ckan-master/dev - file: ckan-master/dev/Dockerfile - push: true - build-args: | - CKAN_VERSION=master - tags: | - ckan/ckan-dev:master +call-reusable-workflow: + uses: ./.github/workflows/reusable-docker-publish.yml + with: + ckan-major-version: "master" + ckan-version: "master" + base-tags: '["ckan/ckan-base:master", "ckan/ckan-base:master-py3.10"]' + dev-tags: '["ckan/ckan-dev:master", "ckan/ckan-dev:master-py3.10"]' diff --git a/.github/workflows/reusable-docker-publish.yml b/.github/workflows/reusable-docker-publish.yml new file mode 100644 index 0000000..0ba6e3b --- /dev/null +++ b/.github/workflows/reusable-docker-publish.yml @@ -0,0 +1,53 @@ +name: Reusable CKAN Docker images build and push + +on: + workflow_call: + inputs: + ckan-major-version: + required: true + type: string + ckan-version: + required: true + type: string + base-tags: + required: true + type: string + dev-tags: + required: true + type: string + docker-file: + required: false + default: 'Dockerfile' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build ${{ inputs.ckan-major-version }} base + uses: docker/build-push-action@v6 + with: + context: ckan-${{ inputs.ckan-major-version }}/base + file: ckan-${{ inputs.ckan-major-version }}/base/${{ inputs.docker-file }} + push: true + build-args: | + CKAN_VERSION=${{ inputs.ckan-version }} + tags: ${{ fromJson(inputs.base-tags) }} + + - name: Build ${{ inputs.ckan-major-version }} dev + uses: docker/build-push-action@v6 + with: + context: ckan-${{ inputs.ckan-major-version }}/dev + file: ckan-${{ inputs.ckan-major-version }}/dev/${{ inputs.docker-file }} + push: true + build-args: | + CKAN_VERSION=${{ inputs.ckan-version }} + tags: ${{ fromJson(inputs.dev-tags) }}