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:
|
|
|
|
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-12-06 11:17:14 +00:00
|
|
|
release:
|
|
|
|
types: [released, prereleased]
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
env:
|
2024-02-08 06:17:52 +00:00
|
|
|
TARGET_BRANCH: ${{ 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
|
2024-02-08 06:17:52 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-11-06 13:35:20 +00:00
|
|
|
outputs:
|
2024-03-11 19:31:03 +00:00
|
|
|
gh_branch_name: ${{ steps.set_env_variables.outputs.TARGET_BRANCH }}
|
2024-02-08 06:17:52 +00:00
|
|
|
gh_buildx_driver: ${{ steps.set_env_variables.outputs.BUILDX_DRIVER }}
|
|
|
|
gh_buildx_version: ${{ steps.set_env_variables.outputs.BUILDX_VERSION }}
|
|
|
|
gh_buildx_platforms: ${{ steps.set_env_variables.outputs.BUILDX_PLATFORMS }}
|
|
|
|
gh_buildx_endpoint: ${{ steps.set_env_variables.outputs.BUILDX_ENDPOINT }}
|
2024-05-08 21:22:00 +00:00
|
|
|
build_proxy: ${{ steps.changed_files.outputs.proxy_any_changed }}
|
|
|
|
build_apiserver: ${{ steps.changed_files.outputs.apiserver_any_changed }}
|
2024-05-08 17:31:20 +00:00
|
|
|
build_admin: ${{ steps.changed_files.outputs.admin_any_changed }}
|
2024-03-11 19:36:37 +00:00
|
|
|
build_space: ${{ steps.changed_files.outputs.space_any_changed }}
|
2024-05-08 21:22:00 +00:00
|
|
|
build_web: ${{ steps.changed_files.outputs.web_any_changed }}
|
2024-02-08 06:17:52 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- id: set_env_variables
|
|
|
|
name: Set Environment Variables
|
|
|
|
run: |
|
2024-02-15 09:22:18 +00:00
|
|
|
if [ "${{ env.TARGET_BRANCH }}" == "master" ] || [ "${{ github.event_name }}" == "release" ]; then
|
2024-02-08 06:17:52 +00:00
|
|
|
echo "BUILDX_DRIVER=cloud" >> $GITHUB_OUTPUT
|
|
|
|
echo "BUILDX_VERSION=lab:latest" >> $GITHUB_OUTPUT
|
|
|
|
echo "BUILDX_PLATFORMS=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
|
|
|
|
echo "BUILDX_ENDPOINT=makeplane/plane-dev" >> $GITHUB_OUTPUT
|
|
|
|
else
|
|
|
|
echo "BUILDX_DRIVER=docker-container" >> $GITHUB_OUTPUT
|
|
|
|
echo "BUILDX_VERSION=latest" >> $GITHUB_OUTPUT
|
|
|
|
echo "BUILDX_PLATFORMS=linux/amd64" >> $GITHUB_OUTPUT
|
2024-02-08 06:56:55 +00:00
|
|
|
echo "BUILDX_ENDPOINT=" >> $GITHUB_OUTPUT
|
2024-02-08 06:17:52 +00:00
|
|
|
fi
|
|
|
|
echo "TARGET_BRANCH=${{ env.TARGET_BRANCH }}" >> $GITHUB_OUTPUT
|
2023-11-06 13:35:20 +00:00
|
|
|
|
2024-02-27 11:22:59 +00:00
|
|
|
- id: checkout_files
|
|
|
|
name: Checkout Files
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Get changed files
|
|
|
|
id: changed_files
|
|
|
|
uses: tj-actions/changed-files@v42
|
|
|
|
with:
|
|
|
|
files_yaml: |
|
2024-05-08 21:22:00 +00:00
|
|
|
apiserver:
|
|
|
|
- apiserver/**
|
|
|
|
proxy:
|
|
|
|
- nginx/**
|
|
|
|
admin:
|
|
|
|
- admin/**
|
2024-02-27 11:22:59 +00:00
|
|
|
- packages/**
|
|
|
|
- 'package.json'
|
|
|
|
- 'yarn.lock'
|
|
|
|
- 'tsconfig.json'
|
|
|
|
- 'turbo.json'
|
|
|
|
space:
|
|
|
|
- space/**
|
|
|
|
- packages/**
|
|
|
|
- 'package.json'
|
|
|
|
- 'yarn.lock'
|
|
|
|
- 'tsconfig.json'
|
|
|
|
- 'turbo.json'
|
2024-05-08 21:22:00 +00:00
|
|
|
web:
|
|
|
|
- web/**
|
2024-05-08 17:31:20 +00:00
|
|
|
- packages/**
|
|
|
|
- 'package.json'
|
|
|
|
- 'yarn.lock'
|
|
|
|
- 'tsconfig.json'
|
|
|
|
- 'turbo.json'
|
2024-02-27 11:22:59 +00:00
|
|
|
|
2024-05-08 21:22:00 +00:00
|
|
|
branch_build_push_web:
|
|
|
|
if: ${{ needs.branch_build_setup.outputs.build_web == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'release' || needs.branch_build_setup.outputs.gh_branch_name == 'master' }}
|
2023-11-06 13:35:20 +00:00
|
|
|
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 }}
|
2024-02-08 06:17:52 +00:00
|
|
|
TARGET_BRANCH: ${{ needs.branch_build_setup.outputs.gh_branch_name }}
|
|
|
|
BUILDX_DRIVER: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
|
|
|
|
BUILDX_VERSION: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
|
|
|
|
BUILDX_PLATFORMS: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
|
|
|
|
BUILDX_ENDPOINT: ${{ needs.branch_build_setup.outputs.gh_buildx_endpoint }}
|
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: |
|
2024-02-15 08:17:26 +00:00
|
|
|
if [ "${{ github.event_name }}" == "release" ]; then
|
2024-02-26 11:02:06 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:stable,${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:${{ github.event.release.tag_name }}
|
2024-02-08 06:17:52 +00:00
|
|
|
elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; then
|
2024-02-26 11:02:06 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:latest
|
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
|
2023-11-06 13:35:20 +00:00
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
2024-02-08 06:17:52 +00:00
|
|
|
uses: docker/login-action@v3
|
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
|
|
|
|
2024-02-08 06:17:52 +00:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
driver: ${{ env.BUILDX_DRIVER }}
|
|
|
|
version: ${{ env.BUILDX_VERSION }}
|
|
|
|
endpoint: ${{ env.BUILDX_ENDPOINT }}
|
|
|
|
|
2024-01-22 09:57:41 +00:00
|
|
|
- name: Check out the repo
|
2024-02-27 11:22:59 +00:00
|
|
|
uses: actions/checkout@v4
|
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
|
2024-02-08 06:17:52 +00:00
|
|
|
platforms: ${{ env.BUILDX_PLATFORMS }}
|
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
|
|
|
|
2024-05-08 17:31:20 +00:00
|
|
|
branch_build_push_admin:
|
|
|
|
if: ${{ needs.branch_build_setup.outputs.build_admin== 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'release' || needs.branch_build_setup.outputs.gh_branch_name == 'master' }}
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
needs: [branch_build_setup]
|
|
|
|
env:
|
|
|
|
ADMIN_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/plane-admin:${{ needs.branch_build_setup.outputs.gh_branch_name }}
|
|
|
|
TARGET_BRANCH: ${{ needs.branch_build_setup.outputs.gh_branch_name }}
|
|
|
|
BUILDX_DRIVER: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
|
|
|
|
BUILDX_VERSION: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
|
|
|
|
BUILDX_PLATFORMS: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
|
|
|
|
BUILDX_ENDPOINT: ${{ needs.branch_build_setup.outputs.gh_buildx_endpoint }}
|
|
|
|
steps:
|
|
|
|
- name: Set Admin Docker Tag
|
|
|
|
run: |
|
|
|
|
if [ "${{ github.event_name }}" == "release" ]; then
|
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-admin:stable,${{ secrets.DOCKERHUB_USERNAME }}/plane-admin:${{ github.event.release.tag_name }}
|
|
|
|
elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; then
|
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-admin:latest
|
|
|
|
else
|
|
|
|
TAG=${{ env.ADMIN_TAG }}
|
|
|
|
fi
|
|
|
|
echo "ADMIN_TAG=${TAG}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
driver: ${{ env.BUILDX_DRIVER }}
|
|
|
|
version: ${{ env.BUILDX_VERSION }}
|
|
|
|
endpoint: ${{ env.BUILDX_ENDPOINT }}
|
|
|
|
|
|
|
|
- name: Check out the repo
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Build and Push Frontend to Docker Container Registry
|
|
|
|
uses: docker/build-push-action@v5.1.0
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./admin/Dockerfile.admin
|
|
|
|
platforms: ${{ env.BUILDX_PLATFORMS }}
|
|
|
|
tags: ${{ env.ADMIN_TAG }}
|
|
|
|
push: true
|
|
|
|
env:
|
|
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2023-11-06 13:35:20 +00:00
|
|
|
branch_build_push_space:
|
2024-03-18 14:18:44 +00:00
|
|
|
if: ${{ needs.branch_build_setup.outputs.build_space == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'release' || needs.branch_build_setup.outputs.gh_branch_name == 'master' }}
|
2023-11-06 13:35:20 +00:00
|
|
|
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 }}
|
2024-02-08 06:17:52 +00:00
|
|
|
TARGET_BRANCH: ${{ needs.branch_build_setup.outputs.gh_branch_name }}
|
|
|
|
BUILDX_DRIVER: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
|
|
|
|
BUILDX_VERSION: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
|
|
|
|
BUILDX_PLATFORMS: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
|
|
|
|
BUILDX_ENDPOINT: ${{ needs.branch_build_setup.outputs.gh_buildx_endpoint }}
|
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: |
|
2024-02-15 08:17:26 +00:00
|
|
|
if [ "${{ github.event_name }}" == "release" ]; then
|
2024-02-26 11:02:06 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space:stable,${{ secrets.DOCKERHUB_USERNAME }}/plane-space:${{ github.event.release.tag_name }}
|
2024-02-08 06:17:52 +00:00
|
|
|
elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; then
|
2024-02-26 11:02:06 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space:latest
|
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
|
|
|
|
2023-11-06 13:35:20 +00:00
|
|
|
- name: Login to Docker Hub
|
2024-02-08 06:17:52 +00:00
|
|
|
uses: docker/login-action@v3
|
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
|
|
|
|
2024-02-08 06:17:52 +00:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
driver: ${{ env.BUILDX_DRIVER }}
|
|
|
|
version: ${{ env.BUILDX_VERSION }}
|
|
|
|
endpoint: ${{ env.BUILDX_ENDPOINT }}
|
|
|
|
|
2024-01-22 09:57:41 +00:00
|
|
|
- name: Check out the repo
|
2024-02-27 11:22:59 +00:00
|
|
|
uses: actions/checkout@v4
|
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
|
2024-02-08 06:17:52 +00:00
|
|
|
platforms: ${{ env.BUILDX_PLATFORMS }}
|
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
|
|
|
|
2024-05-08 21:22:00 +00:00
|
|
|
branch_build_push_apiserver:
|
|
|
|
if: ${{ needs.branch_build_setup.outputs.build_apiserver == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'release' || needs.branch_build_setup.outputs.gh_branch_name == 'master' }}
|
2023-11-06 13:35:20 +00:00
|
|
|
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 }}
|
2024-02-08 06:17:52 +00:00
|
|
|
TARGET_BRANCH: ${{ needs.branch_build_setup.outputs.gh_branch_name }}
|
|
|
|
BUILDX_DRIVER: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
|
|
|
|
BUILDX_VERSION: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
|
|
|
|
BUILDX_PLATFORMS: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
|
|
|
|
BUILDX_ENDPOINT: ${{ needs.branch_build_setup.outputs.gh_buildx_endpoint }}
|
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: |
|
2024-02-15 08:17:26 +00:00
|
|
|
if [ "${{ github.event_name }}" == "release" ]; then
|
2024-02-26 11:02:06 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:stable,${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:${{ github.event.release.tag_name }}
|
2024-02-08 06:17:52 +00:00
|
|
|
elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; then
|
2024-02-26 11:02:06 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:latest
|
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
|
|
|
|
2023-11-06 13:35:20 +00:00
|
|
|
- name: Login to Docker Hub
|
2024-02-08 06:17:52 +00:00
|
|
|
uses: docker/login-action@v3
|
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
|
|
|
|
2024-02-08 06:17:52 +00:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
driver: ${{ env.BUILDX_DRIVER }}
|
|
|
|
version: ${{ env.BUILDX_VERSION }}
|
|
|
|
endpoint: ${{ env.BUILDX_ENDPOINT }}
|
|
|
|
|
2024-01-22 09:57:41 +00:00
|
|
|
- name: Check out the repo
|
2024-02-27 11:22:59 +00:00
|
|
|
uses: actions/checkout@v4
|
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
|
2024-02-08 06:17:52 +00:00
|
|
|
platforms: ${{ env.BUILDX_PLATFORMS }}
|
2023-11-06 13:35:20 +00:00
|
|
|
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:
|
2024-03-18 14:18:44 +00:00
|
|
|
if: ${{ needs.branch_build_setup.outputs.build_proxy == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'release' || needs.branch_build_setup.outputs.gh_branch_name == 'master' }}
|
2023-11-06 13:35:20 +00:00
|
|
|
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 }}
|
2024-02-08 06:17:52 +00:00
|
|
|
TARGET_BRANCH: ${{ needs.branch_build_setup.outputs.gh_branch_name }}
|
|
|
|
BUILDX_DRIVER: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
|
|
|
|
BUILDX_VERSION: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
|
|
|
|
BUILDX_PLATFORMS: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
|
|
|
|
BUILDX_ENDPOINT: ${{ needs.branch_build_setup.outputs.gh_buildx_endpoint }}
|
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: |
|
2024-02-15 08:17:26 +00:00
|
|
|
if [ "${{ github.event_name }}" == "release" ]; then
|
2024-02-26 11:02:06 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:stable,${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:${{ github.event.release.tag_name }}
|
2024-02-08 06:17:52 +00:00
|
|
|
elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; then
|
2024-02-26 11:02:06 +00:00
|
|
|
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:latest
|
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
|
|
|
|
2023-11-06 13:35:20 +00:00
|
|
|
- name: Login to Docker Hub
|
2024-02-08 06:17:52 +00:00
|
|
|
uses: docker/login-action@v3
|
2023-11-06 13:35:20 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2024-02-08 06:17:52 +00:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
driver: ${{ env.BUILDX_DRIVER }}
|
|
|
|
version: ${{ env.BUILDX_VERSION }}
|
|
|
|
endpoint: ${{ env.BUILDX_ENDPOINT }}
|
|
|
|
|
2024-01-22 09:57:41 +00:00
|
|
|
- name: Check out the repo
|
2024-02-27 11:22:59 +00:00
|
|
|
uses: actions/checkout@v4
|
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
|
2024-02-08 06:17:52 +00:00
|
|
|
platforms: ${{ env.BUILDX_PLATFORMS }}
|
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 }}
|