Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split docker image build into kicad nightly and kicad-render and change animation scale #2

Merged
merged 10 commits into from
Apr 9, 2024
24 changes: 22 additions & 2 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: build docker image
name: build kicad-render image
on:
push:
paths:
- Dockerfile
- '*.sh'
- .github/workflows/image.yaml

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
Expand All @@ -21,12 +26,27 @@ jobs:
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
tags: ghcr.io/linalinn/kicad-render:nightly,ghcr.io/linalinn/kicad-render:nightly-${{ steps.date.outputs.date }}
39 changes: 39 additions & 0 deletions .github/workflows/kicad-nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: kicad nightly base
on:
workflow_dispatch:
push:
paths:
- Dockerfile.kicad-nightly
- .github/workflows/kicad-nightly.yaml
jobs:
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
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
build-args: |
"VERSION=${{ github.sha }}-dev"
tags: "ghcr.io/linalinn/kicad:nightly,ghcr.io/linalinn/kicad:nightly-${{ steps.date.outputs.date }}"
14 changes: 1 addition & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive

ARG VERSION=no-version

ENV VERSION=$VERSION

RUN apt-get update -y && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:kicad/kicad-dev-nightly && \
apt-get install kicad-nightly ffmpeg -y && \
rm -rf /var/lib/apt/lists/*
FROM ghcr.io/linalinn/kicad:nightly-2024-04-09-13-16

COPY *.sh /usr/bin/

Expand Down
13 changes: 13 additions & 0 deletions Dockerfile.kicad-nightly
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive

ARG VERSION=no-version

ENV VERSION=$VERSION

RUN apt-get update -y && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:kicad/kicad-dev-nightly && \
apt-get install kicad-nightly ffmpeg -y && \
rm -rf /var/lib/apt/lists/*
4 changes: 2 additions & 2 deletions kicad_animation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ OUTPUT_DIR="${3:-/pwd}"
FRAME_DIR="/tmp/render"
INPUT_FILE="$2"
ZOOM=0.7
WIDTH=1080
HEIGHT=1080
WIDTH=300
HEIGHT=300
ROTATE_X=0
ROTATE_Z=45
ROTATION=360 # Total rotation angle
Expand Down