Skip to content

Commit

Permalink
Fixes to git workflows (#36)
Browse files Browse the repository at this point in the history
* fix workflow

* fix secrets

* working directory

* working directory

* pwd

* build first

* consistency

* formatting

* lint

* lint
  • Loading branch information
elliotBraem authored Dec 7, 2023
1 parent d642dc9 commit 533621b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ on:
required: true
description: "Workspace app name to deploy (from /apps directory)"
type: string
working-directory:
required: false
description: "Relative path to bos-workspace root"
type: string
default: "./"
deploy-account-address:
required: true
description: "Account under which component code should be deployed"
Expand All @@ -28,10 +33,10 @@ on:
required: true
description: "Public key for signing transactions in the format: `ed25519:<public_key>`"
type: string
signer-private-key:
required: true
secrets:
SIGNER_PRIVATE_KEY:
description: "Private key in `ed25519:<private_key>` format for signing transaction"
type: string
required: true

jobs:
deploy-widgets:
Expand All @@ -40,10 +45,11 @@ jobs:
env:
BOS_DEPLOY_ENV: ${{ inputs.deploy-env }}
BOS_APP_NAME: ${{ inputs.app-name }}
BOS_WORKSPACE_DIRECTORY: ${{ inputs.working-directory }}
BOS_DEPLOY_ACCOUNT_ID: ${{ inputs.deploy-account-address }}
BOS_SIGNER_ACCOUNT_ID: ${{ inputs.signer-account-address }}
BOS_SIGNER_PUBLIC_KEY: ${{ inputs.signer-public-key }}
BOS_SIGNER_PRIVATE_KEY: ${{ inputs.signer-private-key }}
BOS_SIGNER_PRIVATE_KEY: ${{ secrets.SIGNER_PRIVATE_KEY }}

steps:
- name: Checkout repository
Expand All @@ -64,9 +70,11 @@ jobs:
- name: Build the workspaces
run: |
bos-workspace build
cd "$BOS_WORKSPACE_DIRECTORY"
npm run build
- name: Deploy widgets
working-directory: ./build/${{ inputs.app-name }}
run: |
pwd
cd "$BOS_WORKSPACE_DIRECTORY/build/$BOS_APP_NAME"
bos components deploy "$BOS_DEPLOY_ACCOUNT_ID" sign-as "$BOS_SIGNER_ACCOUNT_ID" network-config "$BOS_DEPLOY_ENV" sign-with-plaintext-private-key --signer-public-key "$BOS_SIGNER_PUBLIC_KEY" --signer-private-key "$BOS_SIGNER_PRIVATE_KEY" send
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ The build script will create a `data.json` file based on the `jsonc` and `txt` f
For instance, consider the following structure:

```js
- apps
- {appname}
- something.txt
- types
- ui
- imageType.jsonc
- widget
- Button.metadata.jsonc
-apps -
{ appname } -
something.txt -
types -
ui -
imageType.jsonc -
widget -
Button.metadata.jsonc;
```

The `data.json` file will appear as follows:
Expand Down

0 comments on commit 533621b

Please sign in to comment.