-
-
Notifications
You must be signed in to change notification settings - Fork 449
60 lines (56 loc) · 1.77 KB
/
Copy pathdocker.yaml
File metadata and controls
60 lines (56 loc) · 1.77 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
name: Docker
on:
push:
branches: [main]
paths:
- Dockerfile
- .github/actions/smoke-docker-image/action.yml
- .github/workflows/docker.yaml
- .github/workflows/publish.yaml
- tests/data/jsonschema/simple_string.json
pull_request:
branches: [main]
paths:
- Dockerfile
- .github/actions/smoke-docker-image/action.yml
- .github/workflows/docker.yaml
- .github/workflows/publish.yaml
- tests/data/jsonschema/simple_string.json
workflow_dispatch:
concurrency:
group: docker-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
smoke:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 1
persist-credentials: false
- name: Resolve latest release version
id: release
run: |
set -euo pipefail
version="$(
curl -fsSL https://pypi.org/pypi/datamodel-code-generator/json \
| python3 -c 'import json, sys; print(json.load(sys.stdin)["info"]["version"])'
)"
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Build Docker image
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
load: true
tags: datamodel-code-generator:smoke
build-args: |
VERSION=${{ steps.release.outputs.version }}
- name: Smoke test Docker image
uses: ./.github/actions/smoke-docker-image
with:
image: datamodel-code-generator:smoke