Skip to content

build image with branch as tag on none default branch #40

build image with branch as tag on none default branch

build image with branch as tag on none default branch #40

Workflow file for this run

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: PATH="${GITHUB_WORKSPACE}:$PATH" bash 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: PATH="${GITHUB_WORKSPACE}:$PATH" bash 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: PATH="${GITHUB_WORKSPACE}:$PATH" bash 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: PATH="${GITHUB_WORKSPACE}:$PATH" bash 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 != github.event.repository.default_branch
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:${{ github.event.repository.default_branch }}"
- 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 }}