Repository navigation
76 lines (68 loc) · 2.46 KB
/
Copy path_container.yml
File metadata and controls
76 lines (68 loc) · 2.46 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
on:
workflow_call:
inputs:
publish:
type: boolean
description: If true, pushes image to container registry
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
# Need this to get version number from last tag
fetch-depth: 0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GitHub Docker Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and export to Docker local cache
uses: docker/build-push-action@v7
env:
DOCKER_BUILD_RECORD_UPLOAD: false
with:
context: .
# Need load and tags so we can test it below
load: true
tags: tag_for_testing
- name: Test the plugins are served by the cached runtime image
run: |
docker run -d --name smoke -p 8000:8000 \
-v ${{ github.workspace }}/tests/container:/deploy/config:ro \
tag_for_testing \
tiled serve config --host 0.0.0.0 --port 8000 --scalable \
--log-config /deploy/log_config.yml
for i in $(seq 60); do curl -sf localhost:8000/healthz && break; sleep 1; done
# 422 (unknown scan) proves the visr router is mounted; 404 would mean it is not
status=$(curl -s -o /dev/null -w '%{http_code}' localhost:8000/api/v1/binned/none || true)
docker ps -a --filter name=smoke
docker logs smoke
echo "binned status: $status"
test "$status" = 422
- name: Create tags for publishing image
id: meta
uses: docker/metadata-action@v6
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=tag
type=raw,value=latest
- name: Push cached image to container registry
if: inputs.publish && github.ref_type == 'tag'
uses: docker/build-push-action@v7
env:
DOCKER_BUILD_RECORD_UPLOAD: false
# This does not build the image again, it will find the image in the
# Docker cache and publish it
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}