Skip to content
on:
push:
branches:
- mg-manual-build
workflow_dispatch:
inputs:
branch:
required: true
description: "Enter the branch to be built"
default: "develop"
env:
TARGET_BRANCH: ${{ github.event.inputs.branch }}
jobs:
branch_build_setup:
name: Build-Push Web/Space/API/Proxy Docker Image
runs-on: ubuntu-20.04
steps:
- name: Set the branch name
run: |
BRANCH_NAME=$(echo "${{ env.TARGET_BRANCH }}" | sed -e 's/[\.\_\s\/]/-/g')
echo "TARGET_BRANCH=${BRANCH_NAME}" >> $GITHUB_ENV
outputs:
gh_branch_name: ${{ env.TARGET_BRANCH }}
# branch_build_push_frontend:
# runs-on: ubuntu-20.04
# needs: [branch_build_setup]
# env:
# FRONTEND_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend${{ secrets.DOCKER_REPO_SUFFIX || '' }}:${{ needs.branch_build_setup.outputs.gh_branch_name }}
# steps:
# - name: Set Frontend Docker Tag
# run: |
# if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
# TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend${{ secrets.DOCKER_REPO_SUFFIX || '' }}:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend${{ secrets.DOCKER_REPO_SUFFIX || '' }}:${{ github.event.release.tag_name }}
# elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
# TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend${{ secrets.DOCKER_REPO_SUFFIX || '' }}:stable
# else
# TAG=${{ env.FRONTEND_TAG }}
# fi
# echo "FRONTEND_TAG=${TAG}" >> $GITHUB_ENV
# - name: Set up Docker Buildx
# uses: docker/[email protected]
# - name: Login to Docker Hub
# uses: docker/[email protected]
# 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/[email protected]
# with:
# context: .
# file: ./web/Dockerfile.web
# platforms: linux/amd64
# tags: ${{ env.FRONTEND_TAG }}
# push: true
# env:
# DOCKER_BUILDKIT: 1
# DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
# DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
# branch_build_push_space:
# runs-on: ubuntu-20.04
# needs: [branch_build_setup]
# env:
# SPACE_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space${{ secrets.DOCKER_REPO_SUFFIX || '' }}:${{ needs.branch_build_setup.outputs.gh_branch_name }}
# steps:
# - name: Set Space Docker Tag
# run: |
# if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
# TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space${{ secrets.DOCKER_REPO_SUFFIX || '' }}:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-space${{ secrets.DOCKER_REPO_SUFFIX || '' }}:${{ github.event.release.tag_name }}
# elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
# TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space${{ secrets.DOCKER_REPO_SUFFIX || '' }}:stable
# else
# TAG=${{ env.SPACE_TAG }}
# fi
# echo "SPACE_TAG=${TAG}" >> $GITHUB_ENV
# - name: Set up Docker Buildx
# uses: docker/[email protected]
# - name: Login to Docker Hub
# uses: docker/[email protected]
# 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/[email protected]
# with:
# context: .
# file: ./space/Dockerfile.space
# platforms: linux/amd64
# tags: ${{ env.SPACE_TAG }}
# push: true
# env:
# DOCKER_BUILDKIT: 1
# DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
# DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
# branch_build_push_backend:
# runs-on: ubuntu-20.04
# needs: [branch_build_setup]
# env:
# BACKEND_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend${{ secrets.DOCKER_REPO_SUFFIX || '' }}:${{ needs.branch_build_setup.outputs.gh_branch_name }}
# steps:
# - name: Set Backend Docker Tag
# run: |
# if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
# TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend${{ secrets.DOCKER_REPO_SUFFIX || '' }}:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-backend${{ secrets.DOCKER_REPO_SUFFIX || '' }}:${{ github.event.release.tag_name }}
# elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
# TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend${{ secrets.DOCKER_REPO_SUFFIX || '' }}:stable
# else
# TAG=${{ env.BACKEND_TAG }}
# fi
# echo "BACKEND_TAG=${TAG}" >> $GITHUB_ENV
# - name: Set up Docker Buildx
# uses: docker/[email protected]
# - name: Login to Docker Hub
# uses: docker/[email protected]
# 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/[email protected]
# with:
# context: .
# file: ./Dockerfile.api
# platforms: linux/amd64
# push: true
# tags: ${{ env.BACKEND_TAG }}
# env:
# DOCKER_BUILDKIT: 1
# DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
# DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
# branch_build_push_proxy:
# runs-on: ubuntu-20.04
# needs: [branch_build_setup]
# env:
# PROXY_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy${{ secrets.DOCKER_REPO_SUFFIX || '' }}:${{ needs.branch_build_setup.outputs.gh_branch_name }}
# steps:
# - name: Set Proxy Docker Tag
# run: |
# if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
# TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy${{ secrets.DOCKER_REPO_SUFFIX || '' }}:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy${{ secrets.DOCKER_REPO_SUFFIX || '' }}:${{ github.event.release.tag_name }}
# elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
# TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy${{ secrets.DOCKER_REPO_SUFFIX || '' }}:stable
# else
# TAG=${{ env.PROXY_TAG }}
# fi
# echo "PROXY_TAG=${TAG}" >> $GITHUB_ENV
# - name: Set up Docker Buildx
# uses: docker/[email protected]
# - name: Login to Docker Hub
# uses: docker/[email protected]
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Downloading Proxy Source Code
# uses: actions/download-artifact@v3
# with:
# name: proxy-src-code
# - name: Build and Push Plane-Proxy to Docker Hub
# uses: docker/[email protected]
# with:
# context: .
# file: ./Dockerfile
# platforms: linux/amd64
# tags: ${{ env.PROXY_TAG }}
# push: true
# env:
# DOCKER_BUILDKIT: 1
# DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
# DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}