ckan 2.10 github actions for pull request and push to master
This commit is contained in:
parent
24b95e7cad
commit
0231df73f8
|
@ -6,6 +6,71 @@ on:
|
|||
|
||||
|
||||
jobs:
|
||||
build-ckan-2-10:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.CR_PAT }}
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
/tmp/.buildx-cache-alpine-2-10
|
||||
/tmp/.buildx-cache-ubuntu-2-10
|
||||
key: ${{ runner.os }}-buildx-2-10-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-2-10
|
||||
|
||||
- name: Get docker tag for Alpine image
|
||||
id: alpine
|
||||
run: |
|
||||
echo "::set-output name=IMAGE_TAG::$(awk -F '=' '/IMAGE_TAG/{print $2}' ./images/ckan/2.10/Dockerfile)"
|
||||
|
||||
- name: Build and push CKAN 2.10 alpine
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: ./images/ckan/2.10
|
||||
file: ./images/ckan/2.10/Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
keitaro/ckan:${{ steps.alpine.outputs.IMAGE_TAG }}
|
||||
ghcr.io/keitaroinc/ckan:${{ steps.alpine.outputs.IMAGE_TAG }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache-alpine-2-10
|
||||
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-alpine-2-10
|
||||
|
||||
- name: Get docker tag for Ubuntu image
|
||||
id: ubuntu
|
||||
run: |
|
||||
echo "::set-output name=IMAGE_TAG::$(awk -F '=' '/IMAGE_TAG/{print $2}' ./images/ckan/2.10/Dockerfile.focal)"
|
||||
|
||||
- name: Build and push CKAN 2.10 ubuntu
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: ./images/ckan/2.10
|
||||
file: ./images/ckan/2.10/Dockerfile.focal
|
||||
push: true
|
||||
tags: |
|
||||
keitaro/ckan:${{ steps.ubuntu.outputs.IMAGE_TAG }}
|
||||
ghcr.io/keitaroinc/ckan:${{ steps.ubuntu.outputs.IMAGE_TAG }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache-ubuntu-2-10
|
||||
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-ubuntu-2-10
|
||||
|
||||
build-ckan-2-9:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
|
|
|
@ -6,6 +6,57 @@ on:
|
|||
|
||||
|
||||
jobs:
|
||||
build-ckan-2-10:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
/tmp/.buildx-cache-alpine-2-10
|
||||
/tmp/.buildx-cache-ubuntu-2-10
|
||||
key: ${{ runner.os }}-buildx-2-10-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-2-10
|
||||
|
||||
- name: Get docker tag for Alpine image
|
||||
id: alpine
|
||||
run: |
|
||||
echo "::set-output name=IMAGE_TAG::$(awk -F '=' '/IMAGE_TAG/{print $2}' ./images/ckan/2.10/Dockerfile)"
|
||||
|
||||
- name: Build CKAN 2.10 alpine
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: ./images/ckan/2.10
|
||||
file: ./images/ckan/2.10/Dockerfile
|
||||
push: false
|
||||
tags: keitaro/ckan:${{ steps.alpine.outputs.IMAGE_TAG }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache-alpine-2-10
|
||||
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-alpine-2-10
|
||||
|
||||
- name: Get docker tag for Ubuntu image
|
||||
id: ubuntu
|
||||
run: |
|
||||
echo "::set-output name=IMAGE_TAG::$(awk -F '=' '/IMAGE_TAG/{print $2}' ./images/ckan/2.10/Dockerfile.focal)"
|
||||
|
||||
- name: Build CKAN 2.10 ubuntu
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: ./images/ckan/2.10
|
||||
file: ./images/ckan/2.10/Dockerfile.focal
|
||||
push: false
|
||||
tags: keitaro/ckan:${{ steps.ubuntu.outputs.IMAGE_TAG }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache-ubuntu-2-10
|
||||
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-ubuntu-2-10
|
||||
build-args: |
|
||||
--progress=plain
|
||||
|
||||
|
||||
build-ckan-2-9:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
|
|
Loading…
Reference in New Issue