-
Notifications
You must be signed in to change notification settings - Fork 5
70 lines (62 loc) · 2.59 KB
/
image.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
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
name: build kicad-render image
on:
push:
paths:
- Dockerfile
- '*.sh'
- .github/workflows/image.yaml
jobs:
test:
name: Test render-pcb.sh
runs-on: ubuntu-latest
container:
image: ghcr.io/linalinn/kicad:nightly
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: simple render
run: bash ${GITHUB_WORKSPACE}/render-pcb.sh -f "${GITHUB_WORKSPACE}/.github/tests/test pcb/test.kicad_pcb" && test -s "${GITHUB_WORKSPACE}/.github/tests/test pcb/test_top.png"
- name: simple render with output path
run: bash ${GITHUB_WORKSPACE}/render-pcb.sh -f "${GITHUB_WORKSPACE}/.github/tests/test pcb/test.kicad_pcb" -o "${GITHUB_WORKSPACE}/images" && test -s "${GITHUB_WORKSPACE}/images/top.png"
- name: simple render with zoom
run: bash ${GITHUB_WORKSPACE}/render-pcb.sh -f "${GITHUB_WORKSPACE}/.github/tests/test pcb/test.kicad_pcb" -o "${GITHUB_WORKSPACE}/images" -z "0.5" && test -s "${GITHUB_WORKSPACE}/images/top.png"
- name: render with animation
run: bash ${GITHUB_WORKSPACE}/render-pcb.sh -f "${GITHUB_WORKSPACE}/.github/tests/test pcb/test.kicad_pcb" -o "${GITHUB_WORKSPACE}/images" -a "gif" && test -s "${GITHUB_WORKSPACE}/images/rotating.gif"
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d-%H-%M')" >> $GITHUB_OUTPUT
- name: Build and push Docker image dev
if: github.ref_name == 'dev'
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
build-args: |
"VERSION=${{ github.sha }}-dev"
tags: "ghcr.io/linalinn/kicad-render:dev,ghcr.io/linalinn/kicad-render:dev-${{ steps.date.outputs.date }}"
- name: Build and push Docker image
if: github.ref_name == github.event.repository.default_branch
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
build-args: |
"VERSION=${{ github.sha }}"
tags: ghcr.io/linalinn/kicad-render:nightly,ghcr.io/linalinn/kicad-render:nightly-${{ steps.date.outputs.date }}