Skip to content

Commit

Permalink
Merge pull request #619 from ZenUml/cicd/replace-deploy-with-github-a…
Browse files Browse the repository at this point in the history
…ctions

Upgrade firebase version
  • Loading branch information
MrCoder authored Nov 18, 2023
2 parents 4026ea5 + 531bbd2 commit 32217da
Show file tree
Hide file tree
Showing 6 changed files with 1,501 additions and 1,118 deletions.
42 changes: 23 additions & 19 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,41 @@ on:
tags:
- release-*
jobs:
build_and_deploy:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v2
- run: yarn install && yarn build && yarn release
- uses: FirebaseExtended/action-hosting-deploy@v0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_WEB_SEQUENCE_LOCAL }}'
channelId: live
projectId: web-sequence-local
env:
FIREBASE_CLI_PREVIEWS: hostingchannels
node-version: ${{ matrix.node-version }}
- run: yarn install && yarn build
- run: yarn release
- run: yarn deploy:prod --token ${{ secrets.FIREBASE_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTION_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_ACTION_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTION_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_ACTION_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./extension.zip
asset_name: chrome-extension.zip
asset_content_type: application/zip
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./extension.zip
asset_name: chrome-extension.zip
asset_content_type: application/zip

32 changes: 32 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Deploy to Stage

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: yarn install && yarn build
- run: yarn release
- name: Deploy to staging
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' # This conditional will skip the step for Dependabot PRs
run: yarn deploy:staging --token ${{ secrets.FIREBASE_TOKEN }}
- name: Upload artifacts # Find artifacts under actions/jobs
uses: actions/upload-artifact@v3
with:
name: chrome-extension
path: extension
22 changes: 0 additions & 22 deletions .github/workflows/firebase-hosting-merge-staging.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/firebase-hosting-pull-request-staging.yml

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"esprima": "^4.0.0",
"file-saver": "^2.0.2",
"firebase": "^7.16.1",
"firebase-tools": "^8.4.3",
"firebase-tools": "^11.30.0",
"http-server": "^0.12.3",
"jszip": "^3.5.0",
"preact": "10.18.1",
Expand Down
Loading

0 comments on commit 32217da

Please sign in to comment.