name: "Variants demo using --quick-start" # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on: push: paths: - 'kicad/c64psu/*.kicad_sch' - 'kicad/c64psu/*.kicad_pcb' - '.gitea/workflows/kibot_quick_start.yml' pull_request: paths: - 'kicad/c64psu/*.kicad_sch' - 'kicad/c64psu/*.kicad_pcb' - '.gitea/workflows/kibot_quick_start.yml' repository_dispatch: types: [run_qs] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: quick-start: runs-on: kicad-kibot-runner steps: - uses: actions/checkout@v3 with: # So we can run a diff between last 2 changes fetch-depth: '0' - name: Quick Start run: | kibot --quick-start - name: Retrieve results uses: actions/upload-artifact@v3 with: name: Automatic_outputs path: Generated # This step is to upload the results to another repo (web pages) deploy: runs-on: kicad-kibot-runner needs: quick-start steps: - uses: actions/checkout@v4 - name: Retrieve results uses: actions/download-artifact@v3 with: name: Automatic_outputs path: Generated - name: Disable Jekyll # Jekyll will filter the KiRi folders run: | touch Generated/.nojekyll - name: Push to docu branch env: GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} run: | # Set up git identity git config --global user.email "${{ gitea.actor }}@noreply.localhost" git config --global user.name "${{ gitea.actor }}" # Get the repository URL and add authentication REPO_URL=$(git config --get remote.origin.url) AUTHED_URL=${REPO_URL/https:\/\//https:\/\/${GITEA_TOKEN}@} # Clone the docu branch into a separate folder git clone --depth 1 --branch docu "$AUTHED_URL" docu-branch || \ git clone --depth 1 "$AUTHED_URL" docu-branch cd docu-branch git checkout -B docu # Clean old contents and copy new files rm -rf ./* cp -r ../Generated/* ./ # Commit and push if there are changes git add . if ! git diff --cached --quiet; then git commit -m "chore: update deployed documentation" git push --force "$AUTHED_URL" docu else echo "No changes to deploy" fi