Skip to content

Commit

Permalink
Add an initial CI pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Straka <[email protected]>
  • Loading branch information
derekstraka committed Sep 3, 2024
1 parent c9c174c commit aa7a569
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: Publish

on: # yamllint disable-line rule:truthy
push:
branches:
- "main"
tags:
- "**"
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

env:
ORGANIZATION: "derekstraka"
IMAGE_NAME: "yocto"

jobs:
build_push_latest:
runs-on: ubuntu-22.04

steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and save image tag
run: echo "IMAGE_TAG=$([ "${GITHUB_REF_TYPE}" == 'tag' ] && echo "${GITHUB_REF_NAME}" || echo "latest")" >> $GITHUB_ENV

- name: Build docker image
uses: docker/build-push-action@v4
with:
context: .
load: true
tags: ${{ env.ORGANIZATION }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}

- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64,linux/arm64
file: ./Dockerfile
push: ${{ (github.event.ref == 'refs/heads/main') || (startsWith( github.event.ref, 'refs/tags')) }}
tags: ${{ env.ORGANIZATION }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG}}
6 changes: 4 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name: Linting

on: # yamllint disable-line rule:truthy
push:
tags:
- "**"
branches:
- "main"
tags:
- "**"
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

jobs:
lint:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ENV APT_GET_UPDATE 2023-06-30
# hadolint ignore=DL3008
RUN apt-get --quiet --yes update && \
apt-get --quiet --no-install-recommends --yes install gawk wget git-core diffstat unzip \
texinfo gcc-multilib build-essential chrpath socat cpio python3\
texinfo build-essential chrpath socat cpio python3\
python3-pip python3-pexpect xz-utils debianutils iputils-ping \
libsdl1.2-dev xterm sudo curl libssl-dev tmux strace ltrace file && \
apt-get clean && \
Expand Down

0 comments on commit aa7a569

Please sign in to comment.