Skip to content

Commit

Permalink
Added deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
RoelVB committed Jan 10, 2024
1 parent de270ea commit dd66cc8
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ jobs:
- name: Create Chrome build
run: npm run build

- name: Upload Chrome build
uses: actions/upload-artifact@v3
- name: Upload Chrome build artifact
uses: actions/upload-artifact@v4
with:
name: Chrome-build
path: dist/
Expand All @@ -111,8 +111,8 @@ jobs:
- name: Create Edge build
run: npm run build

- name: Upload Edge build
uses: actions/upload-artifact@v3
- name: Upload Edge build artifact
uses: actions/upload-artifact@v4
with:
name: Edge-build
path: dist/
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Deploy

on:
workflow_dispatch:
inputs:
version:
description: New version number
required: true
type: string
commit:
description: Commit the new version and create version tag
type: boolean
isBeta:
description: Bèta build
type: boolean
deploy:
description: Deploy
required: true
type: choice
options:
- Both
- Chrome
- Edge

jobs:
deploy-build:
uses: ./.github/workflows/deploy-build.yml
with:
version: ${{ inputs.version }}
commit: ${{ inputs.commit }}
isBeta: ${{ inputs.isBeta }}
permissions:
contents: write

deploy-chrome:
if: inputs.deploy != 'Edge'
runs-on: ubuntu-latest
needs: [ deploy-build ]
environment: ${{ inputs.isBeta && 'Beta' || 'Stable' }}

permissions:
actions: read

steps:
- name: Download Chrome build
uses: actions/download-artifact@v4
with:
name: Chrome-build
path: Chrome-build

- name: Create ZIP
run: |
cd Chrome-build
zip -r ../Chrome-build.zip *
- name: Upload Chrome Extension
uses: wdzeng/chrome-extension@9cafc5ba58555992c51217628ca7546290a06109 # v1.2.1
with:
extension-id: ${{ vars.CWS_EXTENSIONID }}
client-id: ${{ secrets.CWS_CLIENTID }}
client-secret: ${{ secrets.CWS_SECRET }}
refresh-token: ${{ secrets.CWS_REFRESH }}
upload-only: true
zip-path: Chrome-build.zip

deploy-edge:
if: inputs.deploy != 'Chrome'
runs-on: ubuntu-latest
needs: [ deploy-build ]
environment: ${{ inputs.isBeta && 'Beta' || 'Stable' }}

permissions:
actions: read

steps:
- name: Download Edge build
uses: actions/download-artifact@v4
with:
name: Edge-build
path: Edge-build

- name: Create ZIP
run: |
cd Edge-build
zip -r ../Edge-build.zip *
- name: Upload Edge Add-on
uses: wdzeng/edge-addon@9ee4d774c434c7b8bd5e7c67f377ee6fc6957834 # v1.2.2
with:
product-id: ${{ vars.EDGE_PRODUCTID }}
client-id: ${{ secrets.EDGE_CLIENTID }}
client-secret: ${{ secrets.EDGE_CLIENTSECRET }}
access-token-url: ${{ secrets.EDGE_TOKENURL}}
upload-only: true
zip-path: Edge-build.zip

0 comments on commit dd66cc8

Please sign in to comment.