Skip to content

initial idea for how to structure ephemeral deployment moons #1

initial idea for how to structure ephemeral deployment moons

initial idea for how to structure ephemeral deployment moons #1

name: Deploy Groups (ephemeral)
on:
push:
branches:
- 'do/ephemeral-moons'
#pull_request:
jobs:
build-frontend:
runs-on: ubuntu-latest
name: 'Build Frontend'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install Dependencies
run: npm ci
- working-directory: ./apps/tlon-web
run:
npm run build
- uses: actions/upload-artifact@v4
with:
name: 'ui-dist'
path: apps/tlon-web/dist
glob:
runs-on: ubuntu-latest
name: 'Make a glob'
needs: build-frontend
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: 'ui-dist'
path: apps/tlon-web/dist
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_SERVICE_KEY }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: 'glob'
uses: ./.github/actions/glob
with:
folder: 'apps/tlon-web/dist/*'
docket: 'desk/desk.docket-0'
- name: Commit and Push Glob
run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
git add desk/desk.docket-0
git commit -n -m "update glob: ${{ steps.glob.outputs.hash }} [skip actions]" || echo "No changes to commit"
INPUT=${{ env.tag }}
BRANCH=${INPUT:-"staging"}
git pull origin $BRANCH --rebase --autostash
git push
create_moon:
runs-on: ubuntu-latest
name: "Create Moon"
needs: glob
steps:
- uses: actions/checkout@v4
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_SERVICE_KEY }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- id: create_moon
name: Create Moon
run: |
./.github/helpers/create_moon.sh ephemeral-landscape-apps-moon-host us-central1-a mainnet-tlon-other-2d
env:
SSH_SEC_KEY: ${{ secrets.GCP_SSH_SEC_KEY }}
SSH_PUB_KEY: ${{ secrets.GCP_SSH_PUB_KEY }}
deploy:
needs: create_moon
runs-on: ubuntu-latest
name: "Release to ~binnec-dozzod-marnus (canary)"
steps:
- uses: actions/checkout@v4
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_SERVICE_KEY }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- id: deploy
name: Deploy
run:
./.github/helpers/deploy.sh tloncorp/landscape-apps groups ${{ needs.build_test_images.outputs.moon_name }} us-central1-a mainnet-tlon-other-2d
env:
SSH_SEC_KEY: ${{ secrets.GCP_SSH_SEC_KEY }}
SSH_PUB_KEY: ${{ secrets.GCP_SSH_PUB_KEY }}
URBIT_REPO_TAG: ${{ vars.URBIT_REPO_TAG }}