Skip to content

Commit

Permalink
Merge pull request #33 from urbit/hm/add-github-actions
Browse files Browse the repository at this point in the history
ops: adding github flows
  • Loading branch information
arthyn authored Jan 4, 2023
2 parents 01a2a26 + 1d00973 commit e4a7573
Show file tree
Hide file tree
Showing 13 changed files with 274 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -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 changes: 4 additions & 0 deletions .github/actions/deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM tloncorp/janeway:v0.16.8-dev
COPY entrypoint.sh /entrypoint.sh
EXPOSE 22/tcp
ENTRYPOINT ["/entrypoint.sh"]
32 changes: 32 additions & 0 deletions .github/actions/deploy/action.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 27 additions & 0 deletions .github/actions/deploy/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 changes: 4 additions & 0 deletions .github/actions/release/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM tloncorp/janeway:v0.16.8-dev
COPY entrypoint.sh /entrypoint.sh
EXPOSE 22/tcp
ENTRYPOINT ["/entrypoint.sh"]
32 changes: 32 additions & 0 deletions .github/actions/release/action.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 19 additions & 0 deletions .github/actions/release/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 changes: 23 additions & 0 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 22 additions & 0 deletions .github/workflows/deploy-canary.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 22 additions & 0 deletions .github/workflows/deploy-external.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Deploy Landscape (external)
on:
workflow_dispatch:
inputs:
tag:
type: string
required: true
description: Enter the tag to deploy
jobs:
deploy:
runs-on: ubuntu-latest
name: "Release to ~doznec-dozzod-marzod (external)"
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/release
with:
app: 'landscape'
ship: 'external'
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 changes: 22 additions & 0 deletions .github/workflows/deploy-internal.yml
Original file line number Diff line number Diff line change
@@ -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 }}
22 changes: 22 additions & 0 deletions .github/workflows/deploy-live.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Deploy Landscape (livenet)
on:
workflow_dispatch:
inputs:
tag:
type: string
required: true
description: Enter the tag to deploy
jobs:
deploy:
runs-on: ubuntu-latest
name: "Release to ~mister-dister-dozzod-dozzod (livenet)"
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/release
with:
app: 'landscape'
ship: 'mister'
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 changes: 19 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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 }}

1 comment on commit e4a7573

@vercel
Copy link

@vercel vercel bot commented on e4a7573 Jan 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

garden – ./

garden-git-master-urbit.vercel.app
garden-beige.vercel.app
garden-urbit.vercel.app

Please sign in to comment.