Skip to content

Commit

Permalink
Add client & types to server deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
baileytincher committed Apr 29, 2021
1 parent f172e62 commit 89b2a47
Showing 1 changed file with 97 additions and 3 deletions.
100 changes: 97 additions & 3 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
name: Actually Colab API Deployment

on:
workflow_dispatch
release:
types: [created]

jobs:
server:
name: Deploy editor/server
environment: SLS
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.release.target_commitish }}
ref: ${{ github.event.release.target_commitish }}

- name: Set bot git config name
run: git config --global user.name "GitHub CD bot"

- name: Set bot git config email
run: git config --global user.email "github-cd-bot@actuallycolab.org"

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down Expand Up @@ -44,6 +52,8 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: 12
always-auth: true
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies for root
run: yarn install --frozen-lockfile
Expand All @@ -56,16 +66,100 @@ jobs:
run: yarn install --frozen-lockfile
working-directory: ./server

- name: Create a new release version
run: yarn version --new-version ${{ github.event.release.tag_name }}
working-directory: ./server
env:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy API
run: yarn deploy:prod:ci
working-directory: ./server
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

types:
name: Deploy editor/types
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.release.target_commitish }}

- name: Set bot git config name
run: git config --global user.name "GitHub CD bot"

- name: Set bot git config email
run: git config --global user.email "github-cd-bot@actuallycolab.org"

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12
always-auth: true
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies for types
run: yarn install --frozen-lockfile
working-directory: ./types

- name: Create a new release version
run: yarn version --new-version ${{ github.event.release.tag_name }}
working-directory: ./types
env:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to NPM
run: yarn publish
working-directory: ./types
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

client:
name: Deploy editor/client
runs-on: ubuntu-latest
needs: types
steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.release.target_commitish }}

- name: Set bot git config name
run: git config --global user.name "GitHub CD bot"

- name: Set bot git config email
run: git config --global user.email "github-cd-bot@actuallycolab.org"

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12
always-auth: true
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies for client
run: yarn install --frozen-lockfile
working-directory: ./client

- name: Create a new release version
run: yarn version --new-version ${{ github.event.release.tag_name }}
working-directory: ./client
env:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to NPM
run: yarn publish
working-directory: ./client
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

docs:
name: Dispatch an update to https://docs.actuallycolab.org
runs-on: ubuntu-latest
needs: server
needs: client
steps:
- name: Generate docs site re-deploy
uses: benc-uk/workflow-dispatch@v1.1
Expand Down

0 comments on commit 89b2a47

Please sign in to comment.