diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..2d561b6 --- /dev/null +++ b/.github/workflows/build.yaml @@ -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/login-action@v2.2.0 + 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/build-push-action@v4.1.1 + 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}} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 810f3c9..e93fa67 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -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: diff --git a/Dockerfile b/Dockerfile index 3a6502a..a04d91a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 && \