From f841afa105153d49e22e797d32e976640776ae5f Mon Sep 17 00:00:00 2001 From: Stef <48526421+StefBuwalda@users.noreply.github.com> Date: Sun, 31 Aug 2025 12:14:56 +0200 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9784cc6 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,46 @@ +name: Build and Push to GHCR + +on: + push: + branches: + - main + +permissions: + packages: write + contents: read + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # Checkout code + - name: Checkout code + uses: actions/checkout@v4.2.2 + + # Log in to GHCR + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3.5.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Set up Docker Buildx (needed for ARM64 cross-build) + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.11.1 + + # Build and push Docker image with caching + - name: Build and push ARM64 image + uses: docker/build-push-action@v6.18.0 + with: + context: . + push: true + platforms: linux/arm64 + tags: | + ghcr.io/stefbuwalda/dashboard_test:arm64 + ghcr.io/stefbuwalda/dashboard_test:latest + cache-from: type=registry,ref=ghcr.io/stefbuwalda/dashboard_test:cache + cache-to: type=registry,ref=ghcr.io/stefbuwalda/dashboard_test:cache,mode=max + build-args: | + PIP_NO_CACHE_DIR=1