Skip to content

Commit

Permalink
ci(docs): deploy to firebase (ignite#2419)
Browse files Browse the repository at this point in the history
  • Loading branch information
helder-moreira authored Apr 27, 2022
1 parent ed8c8bf commit abc5714
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"projects": {
"default": "ignite-hq"
},
"targets": {
"ignite-hq": {
"hosting": {
"docs.ignite.com": [
"ignite-go-docs"
]
}
}
}
}
44 changes: 44 additions & 0 deletions .github/workflows/docs-deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Docs Deploy Preview

on:
pull_request:
paths:
- "docs/**"

jobs:
build_and_deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache node_modules
uses: actions/cache@v2
with:
path: docs/node_modules
key: node_modules-${{ hashFiles('**/package-lock.json') }}

- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: npm
cache-dependency-path: docs/package-lock.json

- name: Install Dependencies
run: npm install
working-directory: ./docs

- name: Build
run: npm run build
working-directory: ./docs

- name: Deploy
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_IGNITE_HQ }}"
expires: 7d
target: docs.ignite.com
projectId: ignite-hq
44 changes: 44 additions & 0 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Docs Deploy

on:
push:
branches:
- develop

jobs:
build_and_deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache node_modules
uses: actions/cache@v2
with:
path: docs/node_modules
key: node_modules-${{ hashFiles('**/package-lock.json') }}

- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: npm
cache-dependency-path: docs/package-lock.json

- name: Install Dependencies
run: npm install
working-directory: ./docs

- name: Build
run: npm run build
working-directory: ./docs

- name: Deploy
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_IGNITE_HQ }}"
channelId: live
target: docs.ignite.com
projectId: ignite-hq
13 changes: 13 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"emulators": {
"hosting": {
"host": "localhost",
"port": "3000"
}
},
"hosting": {
"target": "docs.ignite.com",
"public": "docs/.vuepress/dist",
"cleanUrls": true
}
}

0 comments on commit abc5714

Please sign in to comment.