ops: adding github flows

This commit is contained in:
Hunter Miller 2023-01-04 12:17:54 -06:00
parent 3e5d9a7b88
commit 597a5843ab
11 changed files with 230 additions and 0 deletions

26
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,26 @@
---
name: Bug report
about: Is something broken?
title: ''
labels: bug
assignees: ''
---
**Describe the bug, optionally with screenshots**
A clear and concise description of what the bug is. If applicable, add screenshots to help explain your problem.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Additional context:**
- Ship type (comet/moon/planet/star/galaxy)
- Instance type (Tlon-hosted/self-hosted with Port/CLI)
- OS/browser (Safari on MacOS, Chrome on Windows, Firefox on Linux, etc.)

4
.github/actions/deploy/Dockerfile vendored Normal file
View File

@ -0,0 +1,4 @@
FROM tloncorp/janeway:v0.16.8-dev
COPY entrypoint.sh /entrypoint.sh
EXPOSE 22/tcp
ENTRYPOINT ["/entrypoint.sh"]

32
.github/actions/deploy/action.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: 'deploy'
description: 'Create a glob and deploy it to a moon'
inputs:
app:
description: "App to deploy"
required: true
ship:
description: "Ship to deploy to"
required: true
credentials:
description: "base64-encoded GCP Service Account credentials"
required: true
ssh-sec-key:
description: "A base64-encoded SSH secret key for the container to use"
required: true
ssh-pub-key:
description: "The corresponding base64-encoded SSH public key"
required: true
ref:
description: "The github reference to checkout when deploying"
required: false
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.app }}
- ${{ inputs.ship }}
- ${{ inputs.credentials }}
- ${{ inputs.ssh-sec-key }}
- ${{ inputs.ssh-pub-key }}
- ${{ inputs.ref }}

27
.github/actions/deploy/entrypoint.sh vendored Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
echo "$3" | base64 -d > /service-account
echo "$4" | base64 -d > /id_ssh
echo "$5" | base64 -d > /id_ssh.pub
chmod 600 /service-account
chmod 600 /id_ssh
chmod 600 /id_ssh.pub
janeway \
--ci \
--credentials /service-account \
--ssh-key /id_ssh \
release glob \
"$1" \
| bash
janeway \
--ci \
--verbose \
--credentials /service-account \
--ssh-key /id_ssh \
release ota \
"$1" "$2" \
${6:+"--ref"} ${6:+"$6"} \
| bash

4
.github/actions/release/Dockerfile vendored Normal file
View File

@ -0,0 +1,4 @@
FROM tloncorp/janeway:v0.16.8-dev
COPY entrypoint.sh /entrypoint.sh
EXPOSE 22/tcp
ENTRYPOINT ["/entrypoint.sh"]

32
.github/actions/release/action.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: 'release'
description: 'Release to a moon'
inputs:
app:
description: "App to deploy"
required: true
ship:
description: "Ship to deploy to"
required: true
credentials:
description: "base64-encoded GCP Service Account credentials"
required: true
ssh-sec-key:
description: "A base64-encoded SSH secret key for the container to use"
required: true
ssh-pub-key:
description: "The corresponding base64-encoded SSH public key"
required: true
ref:
description: "The github reference to checkout when deploying"
required: false
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.app }}
- ${{ inputs.ship }}
- ${{ inputs.credentials }}
- ${{ inputs.ssh-sec-key }}
- ${{ inputs.ssh-pub-key }}
- ${{ inputs.ref }}

19
.github/actions/release/entrypoint.sh vendored Executable file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
echo "$3" | base64 -d > /service-account
echo "$4" | base64 -d > /id_ssh
echo "$5" | base64 -d > /id_ssh.pub
chmod 600 /service-account
chmod 600 /id_ssh
chmod 600 /id_ssh.pub
janeway \
--ci \
--verbose \
--credentials /service-account \
--ssh-key /id_ssh \
release ota \
"$1" "$2" \
${6:+"--ref"} ${6:+"$6"} \
| bash

23
.github/workflows/bump.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: Version Bump
on:
workflow_dispatch:
inputs:
tag:
type: string
required: true
description: Enter the version
jobs:
deploy:
runs-on: ubuntu-latest
name: "Bumps versions and pushes to master"
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.REPO_TOKEN }}
- name: Bump
run: |
sed -i "s/version\+\[.*]/version+[${{ github.event.inputs.tag }}]/" desk/desk.docket-0
- name: Commit
uses: EndBug/add-and-commit@v9
with:
add: '-A'

22
.github/workflows/deploy-canary.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Deploy Landscape (canary)
on:
workflow_dispatch:
inputs:
tag:
type: string
required: false
description: Enter the tag to deploy
jobs:
deploy:
runs-on: ubuntu-latest
name: "Release to ~binnec-dozzod-marzod (canary)"
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/release
with:
app: 'landscape'
ship: 'canary'
credentials: ${{ secrets.JANEWAY_SERVICE_KEY }}
ssh-sec-key: ${{ secrets.JANEWAY_SSH_SEC_KEY }}
ssh-pub-key: ${{ secrets.JANEWAY_SSH_PUB_KEY }}
ref: ${{ github.event.inputs.tag }}

22
.github/workflows/deploy-internal.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Deploy Landscape (internal)
on:
workflow_dispatch:
inputs:
tag:
type: string
required: true
description: Enter the tag to deploy
jobs:
deploy:
runs-on: ubuntu-latest
name: "Release to ~marnec-dozzod-marzod (internal)"
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/release
with:
app: 'landscape'
ship: 'internal'
credentials: ${{ secrets.JANEWAY_SERVICE_KEY }}
ssh-sec-key: ${{ secrets.JANEWAY_SSH_SEC_KEY }}
ssh-pub-key: ${{ secrets.JANEWAY_SSH_PUB_KEY }}
ref: ${{ github.event.inputs.tag }}

19
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Deploy Landscape
on:
workflow_dispatch:
push:
branches:
- 'master'
jobs:
deploy:
runs-on: ubuntu-latest
name: "Create and deploy a glob to ~wannec-dozzod-marzod (devstream)"
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/deploy
with:
app: 'landscape'
ship: 'devstream'
credentials: ${{ secrets.JANEWAY_SERVICE_KEY }}
ssh-sec-key: ${{ secrets.JANEWAY_SSH_SEC_KEY }}
ssh-pub-key: ${{ secrets.JANEWAY_SSH_PUB_KEY }}