Skip to content

Commit

Permalink
feat: Write hello world add-on and deploy to GitHub Pages (#13)
Browse files Browse the repository at this point in the history
* feat: Write hello world add-on and deploy to GitHub Pages

* fix: main stage URL

* fix: Clean up sample set up

* fix: DS Store capitalization

* refactor: export style of setUpAddon function

Co-authored-by: Aziz Javed <[email protected]>

---------

Co-authored-by: Aziz Javed <[email protected]>
  • Loading branch information
teddyward and azizj1 authored Aug 21, 2024
1 parent 30bb400 commit 5c6c840
Show file tree
Hide file tree
Showing 9 changed files with 1,673 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/publish-sample-add-ons.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Deploy sample Add-ons to GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: addons-web-sdk/samples/hello-world/package-lock.json
# TODO: Currently hardcoded to addons-web-sdk. Need different approach when
# there are multiple samples.
- run: npm run build
working-directory: addons-web-sdk/samples/hello-world
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: page
path: addons-web-sdk/samples/dist
if-no-files-found: error
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Download build
uses: actions/download-artifact@v4
with:
name: page
path: .
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: .
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Build outputs for sample Meet Add-ons
**/dist
**/node_modules
**/.DS_Store
3 changes: 3 additions & 0 deletions addons-web-sdk/samples/hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Hello, World: The Add-on

This is approximately the simplest possible add-on. The only requirements to get started here are npm and GitHub. The intent of publishing this add-on is to demonstrate how easy it is to get started with rendering custom content using an add-on. Please see other samples at <https://github.com/googleworkspace/meet/tree/main/addons-web-sdk/samples> to learn more advanced functionality!
Loading

0 comments on commit 5c6c840

Please sign in to comment.