From 4922278adca3d21e25a2e805fd6b1b9f1e2be04e Mon Sep 17 00:00:00 2001 From: oussama Dahmaz Date: Fri, 23 Aug 2024 19:19:09 +0200 Subject: [PATCH] try to fix raspberrypi build --- .../workflows/docker-image-raspberrypi.yml | 68 +++++++++++++++---- 1 file changed, 56 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docker-image-raspberrypi.yml b/.github/workflows/docker-image-raspberrypi.yml index 5583b30..ceed940 100644 --- a/.github/workflows/docker-image-raspberrypi.yml +++ b/.github/workflows/docker-image-raspberrypi.yml @@ -1,21 +1,65 @@ name: Docker Image RaspberryPI -on: push +on: + push: + branches: + - "**" + tags: + - "v*.*.*" jobs: rpi: name : Generate for RaspberryPI runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + attestations: write + id-token: write + steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Build and push Docker images - uses: docker/build-push-action@v1 - with: - username: ${{ secrets.CONTAINER_GH_LOGIN }} - password: ${{ secrets.CONTAINER_GH_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: | + ghcr.io/yadoms/build_for_raspberrypi + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=raw,value=latest,enable={{is_default_branch}} + type=ref,event=branch + type=ref,event=pr + type=ref,event=tag + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: registry: ghcr.io - repository: yadoms/build_for_raspberrypi - tag_with_ref: true - path: build-raspberrypi - + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: "{{defaultContext}}:build-raspberrypi" + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}