Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Build USB Sidecar

on: # yamllint disable-line rule:truthy
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-container:
runs-on: "ubuntu-latest"
permissions:
contents: "read"
packages: "write"

steps:
- uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: "0.7.1"
- uses: "actions/checkout@v3"

- name: "Login to GitHub Container Hub"
if: github.event_name != 'pull_request'
run: docker login --username "${{ secrets.actor }}" --password "${{ secrets.GITHUB_TOKEN }}" --registry ghcr.io

- name: "Build USB Container Image"
run: earthly +usb-image
env:
EARTHLY_CI: true
EARTHLY_PUSH: ${{ github.event_name != 'pull_request' }}
# Only one platform per https://docs.earthly.dev/docs/earthly-command#build-options
EARTHLY_PLATFORMS: linux/amd64
12 changes: 12 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,15 @@ prettier-lint:

lint:
BUILD +prettier-lint

usb-image:
FROM alpine

RUN mkdir -p /usr/lib/extension-release.d/
RUN echo ID=_any > /usr/lib/extension-release.d/extension-release.kubo
SAVE ARTIFACT /usr/lib/extension-release.d
SAVE ARTIFACT /usr/bin/lsusb
SAVE ARTIFACT /usr/bin/less

images:
BUILD +usb-image