From da982454472bf383d91c975ed5c7686eacdce296 Mon Sep 17 00:00:00 2001 From: Henit Chobisa Date: Wed, 23 Aug 2023 20:31:27 +0000 Subject: [PATCH] chore: added github workflow for plane-proxy --- .github/workflows/push-image-proxy.yml | 56 ++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/push-image-proxy.yml diff --git a/.github/workflows/push-image-proxy.yml b/.github/workflows/push-image-proxy.yml new file mode 100644 index 00000000000..e053c8aa9b6 --- /dev/null +++ b/.github/workflows/push-image-proxy.yml @@ -0,0 +1,56 @@ +name: Build and Push Proxy Docker Image + +on: + pull_request: + types: [closed] + branches: [develop] + release: + types: [released] + +jobs: + build_push_proxy: + name: Build and Push Proxy Docker Image + runs-on: ubuntu-20.04 + + steps: + - name: Check out the repo + uses: actions/checkout@v3.3.0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.5.0 + + - name: Login to Docker Hub + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Pull Request + id: meta_pr + if: ${{ github.event_name == 'pull_request' }} + uses: docker/metadata-action@v4.3.0 + with: + images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy + tags: type=raw,value=develop + + - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release + id: meta + uses: docker/metadata-action@v4.3.0 + if: ${{ github.event_name == 'release' }} + with: + images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy + tags: | + type=ref,event=tag + + - name: Build and Push to Docker Hub + uses: docker/build-push-action@v4.0.0 + with: + context: ./nginx + file: ./nginx/Dockerfile + platforms: linux/amd64 + push: true + tags: ${{ github.event_name == 'release' && steps.meta.outputs.tags || steps.meta_pr.outputs.tags }} + env: + DOCKER_BUILDKIT: 1 + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}