forked from obot-platform/obot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: tweak gh workflow for testing enterprise release
Signed-off-by: Nick Hale <[email protected]>
- Loading branch information
Showing
1 changed file
with
37 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,55 +16,58 @@ on: | |
|
||
jobs: | ||
build: | ||
env: | ||
DEPLOY_TO_TEST: ${{ github.ref_type == 'branch' && secrets.RENDER_TEST_DEPLOY_URL != 'disabled' }} | ||
DEPLOY_TO_MAIN: ${{ github.ref_type == 'branch' && secrets.RENDER_MAIN_DEPLOY_URL != 'disabled' }} | ||
runs-on: depot-ubuntu-22.04 | ||
# env: | ||
# DEPLOY_TO_TEST: ${{ github.ref_type == 'branch' && secrets.RENDER_TEST_DEPLOY_URL != 'disabled' }} | ||
# DEPLOY_TO_MAIN: ${{ github.ref_type == 'branch' && secrets.RENDER_MAIN_DEPLOY_URL != 'disabled' }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Depot | ||
uses: depot/setup-action@v1 | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Log in to Docker Hub | ||
if: ${{ github.ref_type == 'tag' && !contains(github.ref_name, '-rc') }} | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
# - name: Log in to Docker Hub | ||
# if: ${{ github.ref_type == 'tag' && !contains(github.ref_name, '-rc') }} | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
# password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
# Add support for more platforms with QEMU (optional) | ||
# https://github.com/docker/setup-qemu-action | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push OSS Docker image | ||
uses: depot/build-push-action@v1 | ||
uses: docker/build-push-action@v6 | ||
with: | ||
project: bbqjs4tj1g | ||
context: . | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository }}:${{ github.ref_name }} | ||
${{ github.ref_type == 'tag' && !contains(github.ref_name, '-rc') && format('docker.io/obot/{0}:{1}', github.event.repository.name, github.ref_name) || '' }} | ||
ghcr.io/njhale/obot:${{ github.ref_name }} | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
- name: Build and push enterprise Docker image | ||
uses: depot/build-push-action@v1 | ||
uses: docker/build-push-action@v6 | ||
with: | ||
project: bbqjs4tj1g | ||
context: . | ||
push: true | ||
secrets: | | ||
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" | ||
build-args: | | ||
TOOL_REGISTRY_REPOS='github.com/obot-platform/tools,github.com/obot-platform/enterprise-tools' | ||
TOOL_REGISTRY_REPOS='github.com/njhale/tools,github.com/obot-platform/enterprise-tools' | ||
tags: | | ||
ghcr.io/${{ github.repository }}-enterprise:${{ github.ref_name }} | ||
ghcr.io/njhale/obot-enterprise:${{ github.ref_name }} | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
- name: Setup crane | ||
|
@@ -73,22 +76,21 @@ jobs: | |
- name: Copy OSS image to latest tag | ||
if: ${{ github.ref_type == 'tag' && !contains(github.ref_name, '-rc') }} | ||
run: | | ||
crane tag ghcr.io/${{ github.repository }}:${{ github.ref_name }} latest | ||
crane tag docker.io/obot/${{ github.event.repository.name }}:${{ github.ref_name }} latest | ||
crane tag ghcr.io/njhale/obot:${{ github.ref_name }} latest | ||
- name: Copy Enterprise image to latest tag | ||
if: ${{ github.ref_type == 'tag' && !contains(github.ref_name, '-rc') }} | ||
run: | | ||
crane tag ghcr.io/${{ github.repository }}-enterprise:${{ github.ref_name }} latest | ||
- name: Deploy to Test Render | ||
if: ${{ env.DEPLOY_TO_TEST == 'true' }} | ||
uses: joelwmale/[email protected] | ||
with: | ||
url: ${{ secrets.RENDER_TEST_DEPLOY_URL }} | ||
crane tag ghcr.io/njhale/obot-enterprise:${{ github.ref_name }} latest | ||
- name: Deploy to Main Render | ||
if: ${{ env.DEPLOY_TO_MAIN == 'true' }} | ||
uses: joelwmale/[email protected] | ||
with: | ||
url: ${{ secrets.RENDER_MAIN_DEPLOY_URL }} | ||
# - name: Deploy to Test Render | ||
# if: ${{ env.DEPLOY_TO_TEST == 'true' }} | ||
# uses: joelwmale/[email protected] | ||
# with: | ||
# url: ${{ secrets.RENDER_TEST_DEPLOY_URL }} | ||
# | ||
# - name: Deploy to Main Render | ||
# if: ${{ env.DEPLOY_TO_MAIN == 'true' }} | ||
# uses: joelwmale/[email protected] | ||
# with: | ||
# url: ${{ secrets.RENDER_MAIN_DEPLOY_URL }} |