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 }}