-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (36 loc) · 1.39 KB
/
build-and-push.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Build and push
on:
push:
tags:
- "*"
jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Get the tag
id: get_image_tag
run: echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}
# NOTE: this step is necessary because otherwise the build-push-action can't push /o\
# https://github.com/docker/build-push-action/issues/100#issuecomment-715352826
- uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build
id: docker_build
uses: docker/build-push-action@v2
with:
load: true
tags: |
eurodatacube/pygeoapi-eoxhub:${{ steps.get_image_tag.outputs.TAG }}
- name: "Git checkout"
uses: actions/checkout@v2
- name: test and push
run: |
IMG="eurodatacube/pygeoapi-eoxhub:${{ steps.get_image_tag.outputs.TAG }}"
docker run --env PYGEOAPI_CONFIG=/pkp/tests/pygeoapi-test-config.yaml --entrypoint python3 "${IMG}" -m pytest || exit 1
docker run --entrypoint flake8 "${IMG}" pygeoapi_kubernetes_papermill tests || exit 1
docker run --entrypoint mypy "${IMG}" pygeoapi_kubernetes_papermill tests || exit 1
docker push "${IMG}"