Update extension.yml #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Copy Demo to Extension | |
permissions: | |
contents: write | |
on: | |
push: | |
paths: | |
- 'logojump/demo/**' | |
- '.github/workflows/extension.yml' | |
jobs: | |
copy-files: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Copy all demo files except index.html | |
run: | | |
mkdir -p logojump/extension/ | |
rsync -av --exclude='index.html' logojump/demo/ logojump/extension/ | |
- name: Recreate PEM file from secret | |
run: | | |
echo "$PEM" > logojump/extension.pem | |
env: | |
PEM: ${{ secrets.EXTENSION_PEM }} | |
- name: Install crx | |
run: | | |
npm install -g crx | |
- name: Build extension with crx | |
run: | | |
crx pack logojump/extension -o logojump/extension.crx -p logojump/extension.pem | |
- name: Remove file | |
run: | | |
rm logojump/extension.pem | |
- name: Commit and push changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add logojump/extension/ | |
git commit -m "Sync demo files to extension and build [skip ci]" | |
git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }} HEAD:${{ github.ref_name }} | |
fi |