Skip to content

Commit

Permalink
Merge pull request #1 from ethglobal/liam/deploy-script
Browse files Browse the repository at this point in the history
feat: add deploy script to deploy built code
  • Loading branch information
snario authored Oct 3, 2024
2 parents 41fe21a + 016fef9 commit 01b4158
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy Project

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
target: [ethglobal] # add more here for other accounts; implies CLASPRC_{NAME} exists w/ oauth
env:
SCRIPT_ID: "1eKtnybTCz-GKohMdtdEKVDBUzFK3suniSAT0UDEKsM_Fm5dR9aRMs3WN"
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install clasp
run: npm install -g @google/clasp

- name: Set up .clasp.json file
run: |
echo '{"scriptId":"${SCRIPT_ID}","rootDir":"dist"}' > ${{ github.workspace }}/allhands/.clasp.json
- name: Set up OAuth credentials
env:
CLASPRC_CONTENT: ${{ secrets.CLASPRC_${{ matrix.target | upper }} }}
run: |
echo "$CLASPRC_CONTENT" | base64 -d > ~/.clasprc.json
- name: Build the latest
run: npm run build

- name: Deploy ${{ matrix.target }}
run: |
echo "Deploying ${{ matrix.target }}..."
cd ${{ github.workspace }}/allhands
clasp push && echo "Deploying ${{ matrix.target }}... done."

0 comments on commit 01b4158

Please sign in to comment.