2023-11-07 11:53:32 +00:00
|
|
|
name: Branch Build
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
on:
|
2024-01-22 09:57:41 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
branch_name:
|
|
|
|
description: "Branch Name"
|
|
|
|
required: true
|
|
|
|
default: "preview"
|
|
|
|
push:
|
2023-11-24 06:47:31 +00:00
|
|
|
branches:
|
2023-11-07 11:53:32 +00:00
|
|
|
- master
|
2023-11-29 09:28:31 +00:00
|
|
|
- preview
|
2023-11-07 11:53:32 +00:00
|
|
|
- develop
|
2023-12-06 11:17:14 +00:00
|
|
|
release:
|
|
|
|
types: [released, prereleased]
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
env:
|
2024-01-22 09:57:41 +00:00
|
|
|
TARGET_BRANCH: ${{ inputs.branch_name || github.ref_name || github.event.release.target_commitish }}
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-12-01 07:53:50 +00:00
|
|
|
branch_build_setup:
|
2023-11-06 13:35:20 +00:00
|
|
|
name: Build-Push Web/Space/API/Proxy Docker Image
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Check out the repo
|
|
|
|
uses: actions/checkout@v3.3.0
|
|
|
|
outputs:
|
2023-11-29 09:28:31 +00:00
|
|
|
gh_branch_name: ${{ env.TARGET_BRANCH }}
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
branch_build_push_frontend:
|
|
|
|
runs-on: ubuntu-20.04
|
2023-12-01 07:53:50 +00:00
|
|
|
needs: [branch_build_setup]
|
2023-11-29 09:28:31 +00:00
|
|
|
env:
|
2024-01-22 09:57:41 +00:00
|
|
|
FRONTEND_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:${{ needs.branch_build_setup.outputs.gh_branch_name }}
|
2023-11-06 13:35:20 +00:00
|
|
|
steps:
|
2024-01-22 09:57:41 +00:00
|
|
|
- name: Set Frontend Docker Tag
|
2023-11-29 09:28:31 +00:00
|
|
|
run: |
|
2023-12-21 08:22:38 +00:00
|
|
|
if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
|
2024-01-22 09:57:41 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:${{ github.event.release.tag_name }}
|
2023-12-06 11:17:14 +00:00
|
|
|
elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
|
2024-01-22 09:57:41 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:stable
|
2023-11-29 09:28:31 +00:00
|
|
|
else
|
2023-12-01 07:53:50 +00:00
|
|
|
TAG=${{ env.FRONTEND_TAG }}
|
2023-11-29 09:28:31 +00:00
|
|
|
fi
|
|
|
|
echo "FRONTEND_TAG=${TAG}" >> $GITHUB_ENV
|
2024-01-22 09:57:41 +00:00
|
|
|
- name: Docker Setup QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3.0.0
|
|
|
|
|
2023-11-06 13:35:20 +00:00
|
|
|
- name: Set up Docker Buildx
|
2024-01-22 09:57:41 +00:00
|
|
|
uses: docker/setup-buildx-action@v3.0.0
|
|
|
|
with:
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
buildkitd-flags: "--allow-insecure-entitlement security.insecure"
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
2024-01-22 09:57:41 +00:00
|
|
|
uses: docker/login-action@v3.0.0
|
2023-11-06 13:35:20 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2024-01-22 09:57:41 +00:00
|
|
|
|
|
|
|
- name: Check out the repo
|
|
|
|
uses: actions/checkout@v4.1.1
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
- name: Build and Push Frontend to Docker Container Registry
|
2024-01-22 09:57:41 +00:00
|
|
|
uses: docker/build-push-action@v5.1.0
|
2023-11-06 13:35:20 +00:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./web/Dockerfile.web
|
|
|
|
platforms: linux/amd64
|
2023-11-29 09:28:31 +00:00
|
|
|
tags: ${{ env.FRONTEND_TAG }}
|
2023-11-06 13:35:20 +00:00
|
|
|
push: true
|
|
|
|
env:
|
|
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
2023-11-07 11:53:32 +00:00
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
branch_build_push_space:
|
|
|
|
runs-on: ubuntu-20.04
|
2023-12-01 07:53:50 +00:00
|
|
|
needs: [branch_build_setup]
|
2023-11-29 09:28:31 +00:00
|
|
|
env:
|
2024-01-22 09:57:41 +00:00
|
|
|
SPACE_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space:${{ needs.branch_build_setup.outputs.gh_branch_name }}
|
2023-11-06 13:35:20 +00:00
|
|
|
steps:
|
2024-01-22 09:57:41 +00:00
|
|
|
- name: Set Space Docker Tag
|
2023-11-29 09:28:31 +00:00
|
|
|
run: |
|
2023-12-06 11:17:14 +00:00
|
|
|
if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
|
2024-01-22 09:57:41 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-space:${{ github.event.release.tag_name }}
|
2023-12-06 11:17:14 +00:00
|
|
|
elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
|
2024-01-22 09:57:41 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space:stable
|
2023-11-29 09:28:31 +00:00
|
|
|
else
|
2023-12-01 07:53:50 +00:00
|
|
|
TAG=${{ env.SPACE_TAG }}
|
2023-11-29 09:28:31 +00:00
|
|
|
fi
|
|
|
|
echo "SPACE_TAG=${TAG}" >> $GITHUB_ENV
|
2024-01-22 09:57:41 +00:00
|
|
|
|
|
|
|
- name: Docker Setup QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3.0.0
|
|
|
|
|
2023-11-06 13:35:20 +00:00
|
|
|
- name: Set up Docker Buildx
|
2024-01-22 09:57:41 +00:00
|
|
|
uses: docker/setup-buildx-action@v3.0.0
|
|
|
|
with:
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
buildkitd-flags: "--allow-insecure-entitlement security.insecure"
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
2024-01-22 09:57:41 +00:00
|
|
|
uses: docker/login-action@v3.0.0
|
2023-11-06 13:35:20 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2024-01-22 09:57:41 +00:00
|
|
|
|
|
|
|
- name: Check out the repo
|
|
|
|
uses: actions/checkout@v4.1.1
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
- name: Build and Push Space to Docker Hub
|
2024-01-22 09:57:41 +00:00
|
|
|
uses: docker/build-push-action@v5.1.0
|
2023-11-06 13:35:20 +00:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./space/Dockerfile.space
|
|
|
|
platforms: linux/amd64
|
2023-11-29 09:28:31 +00:00
|
|
|
tags: ${{ env.SPACE_TAG }}
|
2023-11-06 13:35:20 +00:00
|
|
|
push: true
|
|
|
|
env:
|
|
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
2023-11-07 11:53:32 +00:00
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
branch_build_push_backend:
|
|
|
|
runs-on: ubuntu-20.04
|
2023-12-01 07:53:50 +00:00
|
|
|
needs: [branch_build_setup]
|
2023-11-29 09:28:31 +00:00
|
|
|
env:
|
2024-01-22 09:57:41 +00:00
|
|
|
BACKEND_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:${{ needs.branch_build_setup.outputs.gh_branch_name }}
|
2023-11-06 13:35:20 +00:00
|
|
|
steps:
|
2024-01-22 09:57:41 +00:00
|
|
|
- name: Set Backend Docker Tag
|
2023-11-29 09:28:31 +00:00
|
|
|
run: |
|
2023-12-06 11:17:14 +00:00
|
|
|
if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
|
2024-01-22 09:57:41 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:${{ github.event.release.tag_name }}
|
2023-12-06 11:17:14 +00:00
|
|
|
elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
|
2024-01-22 09:57:41 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:stable
|
2023-11-29 09:28:31 +00:00
|
|
|
else
|
|
|
|
TAG=${{ env.BACKEND_TAG }}
|
|
|
|
fi
|
|
|
|
echo "BACKEND_TAG=${TAG}" >> $GITHUB_ENV
|
2024-01-22 09:57:41 +00:00
|
|
|
|
|
|
|
- name: Docker Setup QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3.0.0
|
|
|
|
|
2023-11-06 13:35:20 +00:00
|
|
|
- name: Set up Docker Buildx
|
2024-01-22 09:57:41 +00:00
|
|
|
uses: docker/setup-buildx-action@v3.0.0
|
|
|
|
with:
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
buildkitd-flags: "--allow-insecure-entitlement security.insecure"
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
2024-01-22 09:57:41 +00:00
|
|
|
uses: docker/login-action@v3.0.0
|
2023-11-06 13:35:20 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2024-01-22 09:57:41 +00:00
|
|
|
|
|
|
|
- name: Check out the repo
|
|
|
|
uses: actions/checkout@v4.1.1
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
- name: Build and Push Backend to Docker Hub
|
2024-01-22 09:57:41 +00:00
|
|
|
uses: docker/build-push-action@v5.1.0
|
2023-11-06 13:35:20 +00:00
|
|
|
with:
|
2024-01-22 09:57:41 +00:00
|
|
|
context: ./apiserver
|
|
|
|
file: ./apiserver/Dockerfile.api
|
2023-11-06 13:35:20 +00:00
|
|
|
platforms: linux/amd64
|
|
|
|
push: true
|
2023-11-29 09:28:31 +00:00
|
|
|
tags: ${{ env.BACKEND_TAG }}
|
2023-11-06 13:35:20 +00:00
|
|
|
env:
|
|
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
2023-11-07 11:53:32 +00:00
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
branch_build_push_proxy:
|
|
|
|
runs-on: ubuntu-20.04
|
2023-12-01 07:53:50 +00:00
|
|
|
needs: [branch_build_setup]
|
2023-11-29 09:28:31 +00:00
|
|
|
env:
|
2024-01-22 09:57:41 +00:00
|
|
|
PROXY_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:${{ needs.branch_build_setup.outputs.gh_branch_name }}
|
2023-11-06 13:35:20 +00:00
|
|
|
steps:
|
2024-01-22 09:57:41 +00:00
|
|
|
- name: Set Proxy Docker Tag
|
2023-11-29 09:28:31 +00:00
|
|
|
run: |
|
2023-12-06 11:17:14 +00:00
|
|
|
if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
|
2024-01-22 09:57:41 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:${{ github.event.release.tag_name }}
|
2023-12-06 11:17:14 +00:00
|
|
|
elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
|
2024-01-22 09:57:41 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:stable
|
2023-11-29 09:28:31 +00:00
|
|
|
else
|
|
|
|
TAG=${{ env.PROXY_TAG }}
|
|
|
|
fi
|
|
|
|
echo "PROXY_TAG=${TAG}" >> $GITHUB_ENV
|
2024-01-22 09:57:41 +00:00
|
|
|
|
|
|
|
- name: Docker Setup QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3.0.0
|
|
|
|
|
2023-11-06 13:35:20 +00:00
|
|
|
- name: Set up Docker Buildx
|
2024-01-22 09:57:41 +00:00
|
|
|
uses: docker/setup-buildx-action@v3.0.0
|
|
|
|
with:
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
buildkitd-flags: "--allow-insecure-entitlement security.insecure"
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
2024-01-22 09:57:41 +00:00
|
|
|
uses: docker/login-action@v3.0.0
|
2023-11-06 13:35:20 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2024-01-22 09:57:41 +00:00
|
|
|
- name: Check out the repo
|
|
|
|
uses: actions/checkout@v4.1.1
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
- name: Build and Push Plane-Proxy to Docker Hub
|
2024-01-22 09:57:41 +00:00
|
|
|
uses: docker/build-push-action@v5.1.0
|
2023-11-06 13:35:20 +00:00
|
|
|
with:
|
2024-01-22 09:57:41 +00:00
|
|
|
context: ./nginx
|
|
|
|
file: ./nginx/Dockerfile
|
2023-11-06 13:35:20 +00:00
|
|
|
platforms: linux/amd64
|
2023-11-29 09:28:31 +00:00
|
|
|
tags: ${{ env.PROXY_TAG }}
|
2023-11-06 13:35:20 +00:00
|
|
|
push: true
|
|
|
|
env:
|
|
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
2023-11-07 11:53:32 +00:00
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
|