diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml new file mode 100644 index 0000000..f582fb0 --- /dev/null +++ b/.github/workflows/build_images.yml @@ -0,0 +1,37 @@ +name: Build & Push Images + +on: + push: + branches: [main] + path: [.github/workflows, tools/build_container] + workflow_dispatch: + +permissions: + packages: write + contents: read + +jobs: + docker-build: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set image name + run: echo "IMAGE_NAME=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/cross_compiler_unix:1" >> $GITHUB_ENV + + - name: Build Docker image + run: docker build -t $IMAGE_NAME ./tools/build_container/ + + - name: Push Docker image + run: docker push $IMAGE_NAME diff --git a/tools/build_container/Dockerfile b/tools/build_container/Dockerfile new file mode 100644 index 0000000..80739b7 --- /dev/null +++ b/tools/build_container/Dockerfile @@ -0,0 +1,13 @@ +FROM debian:stable + +WORKDIR /home + +RUN apt-get update && apt-get install -y \ + build-essential \ + gcc-12 \ + gcc-12-arm-linux-gnueabihf \ + gcc-12-mips-linux-gnu \ + gcc-12-mipsel-linux-gnu \ + gcc-12-riscv64-linux-gnu \ + gcc-12-aarch64-linux-gnu \ + gcc-12-multilib \ No newline at end of file