Skip to content

Commit

Permalink
Deploy registry and signature to gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtenz committed Mar 21, 2023
1 parent fa4f052 commit 2ceea77
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions .github/workflows/publish-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,44 @@ on:

jobs:
check-updated:
name: Check if registry file was updated
runs-on: ubuntu-latest
outputs:
EXIT_CODE: ${{ steps.exit-code.outputs.EXIT_CODE }}
steps:
- uses: actions/checkout@v3
- name: Check if registry file was updated
id: check-updated
id: exit-code
run: |
git diff --name-only HEAD^ HEAD | grep -q registry.json
echo "::set-output name=updated::$?"
git diff --name-only HEAD^ HEAD | grep -q src/registry.json
echo "EXIT_CODE=$?" >> "$GITHUB_OUTPUT"
publish-registry:
name: Deploy registry to `gh-pages` branch
environment: npm-publish
needs: check-updated
if: ${{ needs.check-updated.outputs.EXIT_CODE == 0 }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install Yarn dependencies
run: yarn --immutable
- name: Sign registry
run: yarn sign
env:
PRIVATE_KEY: ${{ secrets.REGISTRY_PRIVATE_KEY }}
- run: |
mkdir -p dist
cp src/registry.json dist/registry.json
cp src/signature.json dist/signature.json
- name: Deploy registry
uses: peaceiris/actions-gh-pages@de7ea6f8efb354206b205ef54722213d99067935
with:
personal_token: ${{ secrets.METAMASKBOT_TOKEN }}
publish_dir: ./dist
destination_dir: latest

0 comments on commit 2ceea77

Please sign in to comment.