From 55ea9e59635155068eb4ca4ba1d3a544b9fba524 Mon Sep 17 00:00:00 2001 From: jr-k Date: Thu, 8 Aug 2024 03:06:00 +0200 Subject: [PATCH] add pr build --- .github/workflows/nightly-build.yml | 2 +- .github/workflows/pr-build.yml | 43 +++++++++++++++++++++++++++++ .github/workflows/release-build.yml | 2 +- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100755 .github/workflows/pr-build.yml diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 9fa7f8c..1628b47 100755 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -1,4 +1,4 @@ -name: Nightly build synced with develop and push docker images +name: Nightly build synced with develop and push docker image on: schedule: diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml new file mode 100755 index 0000000..4dc3f5e --- /dev/null +++ b/.github/workflows/pr-build.yml @@ -0,0 +1,43 @@ +name: Pull-Request build and push ghcr image + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: + - develop + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: ghcr.io/${{ github.repository_owner }}/obscreen:pr-${{ github.event.number }} + platforms: linux/amd64, linux/arm64/v8, linux/arm/v7 + + - name: Create and push manifest + uses: docker/metadata-action@v3 + with: + images: ghcr.io/${{ github.repository_owner }}/obscreen + tags: pr-${{ github.event.number }} diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 7ce3aed..fe51f2f 100755 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -1,4 +1,4 @@ -name: Release build and push docker images +name: Release build and push docker image on: push: