From 5e6d03d093ac2449ca144b1a8f90591226caa3f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Aus=C3=B3?= Date: Sat, 5 Oct 2024 11:01:56 +0200 Subject: [PATCH] chore: Add GitHub Actions workflow for building Docker images --- .github/workflows/pull_request.yml | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..aa7898d --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,42 @@ +name: Build Docker Images + +on: pull_request + +env: + IMAGE_NAME: mtubev7 + DOCKER_REPOSITORY: ${{ github.repository_owner }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Set outputs + id: vars + run: | + echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/arm/v7 + push: true + tags: | + ${{ env.DOCKER_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.branch }}