forked from github/plane
Merge pull request #2694 from makeplane/dev/mg-branch-build-2
Dev/mg branch build 2
This commit is contained in:
commit
ef3d3cc5de
182
.github/workflows/build-branch.yml
vendored
182
.github/workflows/build-branch.yml
vendored
@ -2,6 +2,9 @@
|
||||
name: Docker Branch Build
|
||||
|
||||
on:
|
||||
# push:
|
||||
# branches:
|
||||
# - "*"
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
@ -16,9 +19,9 @@ on:
|
||||
tags:
|
||||
description: 'Dev/QA Builds'
|
||||
|
||||
|
||||
env:
|
||||
gh_branch: ${{ github.ref_name }}
|
||||
img_tag: latest
|
||||
TARGET_BRANCH: ''
|
||||
|
||||
jobs:
|
||||
branch_build_and_push:
|
||||
@ -30,10 +33,18 @@ jobs:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v3.3.0
|
||||
|
||||
- name: Set Target Branch Name on PR close
|
||||
if: ${{ github.event_name == 'pull_request' && github.event.action =='closed' }}
|
||||
run: echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Set Target Branch Name on other than PR close
|
||||
if: ${{ github.event.action !='closed' }}
|
||||
run: echo "TARGET_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
|
||||
|
||||
- uses: ASzc/change-string-case-action@v2
|
||||
id: gh_branch_upper_lower
|
||||
with:
|
||||
string: ${{ env.gh_branch }}
|
||||
string: ${{env.TARGET_BRANCH}}
|
||||
|
||||
- uses: mad9000/actions-find-and-replace-string@2
|
||||
id: gh_branch_replace_slash
|
||||
@ -89,95 +100,95 @@ jobs:
|
||||
outputs:
|
||||
gh_branch_name: ${{ steps.gh_branch_clean.outputs.value }}
|
||||
|
||||
branch_build_push_frontend:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: [ branch_build_and_push ]
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2.5.0
|
||||
# branch_build_push_frontend:
|
||||
# runs-on: ubuntu-20.04
|
||||
# needs: [ branch_build_and_push ]
|
||||
# steps:
|
||||
# - 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: Downloading Web Source Code
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: web-src-code
|
||||
# - name: Login to Docker Hub
|
||||
# uses: docker/login-action@v2.1.0
|
||||
# with:
|
||||
# username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
# password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
# - name: Downloading Web Source Code
|
||||
# uses: actions/download-artifact@v3
|
||||
# with:
|
||||
# name: web-src-code
|
||||
|
||||
- name: Build and Push Frontend to Docker Container Registry
|
||||
uses: docker/build-push-action@v4.0.0
|
||||
with:
|
||||
context: .
|
||||
file: ./web/Dockerfile.web
|
||||
platforms: linux/amd64
|
||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-private:${{ needs.branch_build_and_push.outputs.gh_branch_name }}
|
||||
push: true
|
||||
env:
|
||||
DOCKER_BUILDKIT: 1
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
# - name: Build and Push Frontend to Docker Container Registry
|
||||
# uses: docker/build-push-action@v4.0.0
|
||||
# with:
|
||||
# context: .
|
||||
# file: ./web/Dockerfile.web
|
||||
# platforms: linux/amd64
|
||||
# tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-private:${{ needs.branch_build_and_push.outputs.gh_branch_name }}
|
||||
# push: true
|
||||
# env:
|
||||
# DOCKER_BUILDKIT: 1
|
||||
# DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
# DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
branch_build_push_space:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: [ branch_build_and_push ]
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2.5.0
|
||||
# branch_build_push_space:
|
||||
# runs-on: ubuntu-20.04
|
||||
# needs: [ branch_build_and_push ]
|
||||
# steps:
|
||||
# - 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: Downloading Space Source Code
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: space-src-code
|
||||
# - name: Login to Docker Hub
|
||||
# uses: docker/login-action@v2.1.0
|
||||
# with:
|
||||
# username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
# password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
# - name: Downloading Space Source Code
|
||||
# uses: actions/download-artifact@v3
|
||||
# with:
|
||||
# name: space-src-code
|
||||
|
||||
- name: Build and Push Space to Docker Hub
|
||||
uses: docker/build-push-action@v4.0.0
|
||||
with:
|
||||
context: .
|
||||
file: ./space/Dockerfile.space
|
||||
platforms: linux/amd64
|
||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-private:${{ needs.branch_build_and_push.outputs.gh_branch_name }}
|
||||
push: true
|
||||
env:
|
||||
DOCKER_BUILDKIT: 1
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
# - name: Build and Push Space to Docker Hub
|
||||
# uses: docker/build-push-action@v4.0.0
|
||||
# with:
|
||||
# context: .
|
||||
# file: ./space/Dockerfile.space
|
||||
# platforms: linux/amd64
|
||||
# tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-private:${{ needs.branch_build_and_push.outputs.gh_branch_name }}
|
||||
# push: true
|
||||
# env:
|
||||
# DOCKER_BUILDKIT: 1
|
||||
# DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
# DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
branch_build_push_backend:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: [ branch_build_and_push ]
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2.5.0
|
||||
# branch_build_push_backend:
|
||||
# runs-on: ubuntu-20.04
|
||||
# needs: [ branch_build_and_push ]
|
||||
# steps:
|
||||
# - 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: Downloading Backend Source Code
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: backend-src-code
|
||||
# - name: Login to Docker Hub
|
||||
# uses: docker/login-action@v2.1.0
|
||||
# with:
|
||||
# username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
# password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
# - name: Downloading Backend Source Code
|
||||
# uses: actions/download-artifact@v3
|
||||
# with:
|
||||
# name: backend-src-code
|
||||
|
||||
- name: Build and Push Backend to Docker Hub
|
||||
uses: docker/build-push-action@v4.0.0
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile.api
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-private:${{ needs.branch_build_and_push.outputs.gh_branch_name }}
|
||||
env:
|
||||
DOCKER_BUILDKIT: 1
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
# - name: Build and Push Backend to Docker Hub
|
||||
# uses: docker/build-push-action@v4.0.0
|
||||
# with:
|
||||
# context: .
|
||||
# file: ./Dockerfile.api
|
||||
# platforms: linux/amd64
|
||||
# push: true
|
||||
# tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-private:${{ needs.branch_build_and_push.outputs.gh_branch_name }}
|
||||
# env:
|
||||
# DOCKER_BUILDKIT: 1
|
||||
# DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
# DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
branch_build_push_proxy:
|
||||
runs-on: ubuntu-20.04
|
||||
@ -208,4 +219,5 @@ jobs:
|
||||
env:
|
||||
DOCKER_BUILDKIT: 1
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user