atomic_docs_generated #199
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: Create New CodeSandBoxDemo | |
on: | |
repository_dispatch: | |
types: [atomic_docs_generated] | |
jobs: | |
create-new-version-demo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@v2 | |
with: | |
egress-policy: audit | |
- name: Setup Ruby in runner | |
uses: ruby/setup-ruby@ee26e27437bde475b19a6bf8cb73c9fa658876a2 | |
with: | |
ruby-version: '3.1.2' | |
env: | |
ImageOS: ubuntu22 | |
- uses: actions/checkout@v4 | |
- run: 'echo "payload: ${{ toJson(github.event.client_payload) }}"' | |
- name: Make a new Branch | |
run: | | |
git checkout -b "${{ github.event.client_payload.atomic_version }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run script to update package.json and CDN in index.html on new branch | |
run: | | |
gem install nokogiri | |
cd .github/scripts | |
ruby update_package.rb ${{ github.event.client_payload.atomic_version }} | |
cd ../.. | |
git config user.name ${{ secrets.AUTHOR }} | |
git config user.email ${{ secrets.AUTHOR_EMAIL }} | |
git status | |
git add index.html | |
git commit -m "updated version" | |
git push --set-upstream origin ${{ github.event.client_payload.atomic_version }} |