Skip to content

Commit

Permalink
Merge pull request #4 from OKN-CollabNext/github-deploy
Browse files Browse the repository at this point in the history
Add GitHub Actions Workflow to Deploy to Observable
  • Loading branch information
lewlefton committed Apr 14, 2024
2 parents 7ee5e0c + fb2206a commit 8b8aea6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy

on:
# Run this workflow whenever a new commit is pushed to main.
push: { branches: [main] }
# Run this workflow when triggered manually in GitHub’s UI.
workflow_dispatch: {}

jobs:
deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: observable
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache-dependency-path: observable/package.json
- uses: actions/setup-python@v5
with:
python-version: "3.11.4"
- name: Setup Poetry
uses: Gr1N/setup-poetry@v8
with:
poetry-version: "1.7.1"
- run: poetry install --no-root
- run: yarn install --frozen-lockfile
- run: poetry run yarn build
- name: Deploy to Observable Cloud
# This parameter to `--message` will use the latest commit message
run: yarn deploy -- --message "$(git log -1 --pretty=%s)"
env:
# Auth token to deploy to Observable Cloud
OBSERVABLE_TOKEN: ${{ secrets.OBSERVABLE_TOKEN }}
5 changes: 5 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ def run(c):
@task
def deploy(c):
c.run("cd observable && yarn deploy")


@task
def clean_branches(c):
c.run("git branch | grep -v 'main' | xargs git branch -D")

0 comments on commit 8b8aea6

Please sign in to comment.