Skip to content

Create Sovereign Edition containers and also push a new production Cloud Deployment #1

Create Sovereign Edition containers and also push a new production Cloud Deployment

Create Sovereign Edition containers and also push a new production Cloud Deployment #1

name: Create Sovereign Edition containers and also push a new production Cloud Deployment
on:
release:
types: [created]
jobs:
cloud_deployment:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: false
persist-credentials: false
fetch-depth: 0
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.TENZIR_AUTOBUMPER_APP_ID }}
private-key: ${{ secrets.TENZIR_AUTOBUMPER_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Deploy tenant-manager
if: |
(github.event_type == 'workflow_dispatch' && inputs.deploy-tenant-manager) ||
(github.event_type == 'push' && contains(steps.files.outputs.files-changed, 'components/tenant-manager'))
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
# The workflow_dispatch only supports tags or branches as targets,
# not direct commit hashes, so we push a branch first.
git submodule set-url components/tenant-manager https://x-access-token:[email protected]/tenzir/event-horizon.git/
git submodule update --init components/tenant-manager
git -C components/tenant-manager push -f origin ${{ steps.files.outputs.tenant-manager-commit }}:refs/heads/platform-prod
gh workflow -R tenzir/event-horizon run tzcp-deploy-production.yaml \
--ref platform-prod
- name: Deploy app
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
git submodule set-url components/app https://x-access-token:[email protected]/tenzir/app.git/
git submodule update --init components/app
git -C components/app push -f origin ${{ steps.files.outputs.app-commit }}:refs/heads/platform-prod
gh workflow -R tenzir/app run deploy-to-vercel.yaml \
--ref platform-prod \
-f deploy-production=true
attach_release_artifacts:
runs-on: ubuntu-latest
steps:
- name: Create tarball
run: |
tar cf platform.tar README.md LICENSE examples/
- name: Publish tarball to the GitHub Release
if: ${{ github.event_name == 'release' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "platform.tar"
asset_name: "platform.tar"
asset_content_type: application/x-tar
build_and_push_containers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Check out code
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & push Docker image
with:
image: tenzir-dex
tags: platform-${{ github.event.release.tag_name }}
registry: ghcr.io
directory: components/dex
dockerfile: components/dex/Dockerfile
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & push Docker image
with:
image: tenzir-seaweed
tags: platform-${{ github.event.release.tag_name }}
registry: ghcr.io
directory: components/seaweed
dockerfile: components/seaweed/Dockerfile
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & push Docker image
with:
image: platform
tags: platform-${{ github.event.release.tag_name }}
registry: ghcr.io
directory: components/tenant-manager/platform/tenant_manager
dockerfile: components/tenant-manager/platform/tenant_manager/Dockerfile
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & push Docker image
with:
image: tenzir-platform
tags: platform-${{ github.event.release.tag_name }}
registry: ghcr.io
directory: components/tenant-manager/platform/public_cli
dockerfile: components/tenant-manager/platform/public_cli/Dockerfile
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & push Docker image
with:
image: tenzir-app
tags: platform-${{ github.event.release.tag_name }}
registry: ghcr.io
directory: components/app
dockerfile: components/app/Dockerfile
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}