Bump to JSOSolvers 0.14 in Comparing subsolvers for nonlinear least s… #71
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: Deploy to website | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "**/*.jmd" | |
| - "**/Project.toml" | |
| workflow_dispatch: | |
| jobs: | |
| generate-job-strategy-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| job-strategy-matrix: ${{ steps.generate.outputs.job-strategy-matrix }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 5 | |
| - name: Generate MATRIX | |
| id: generate | |
| run: | | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| MATRIX=$( ( | |
| echo '{ "tutorial": [' | |
| find . -name "*.jmd" | sed -r 's/.\/(.*)/\"\1\"/g' | sed '$!s/$/,/' | |
| echo ']}' | |
| ) | jq -c .) | |
| else | |
| MATRIX=$( ( | |
| echo '{ "tutorial": [' | |
| git diff --name-only HEAD HEAD~1 | grep -E "(jmd|Project.toml)" | sed 's/Project.toml/index.jmd/g' | uniq | sed -r 's/(.*)/\"\1\"/g' | sed '$!s/$/,/' | |
| echo ']}' | |
| ) | jq -c .) | |
| fi | |
| echo $MATRIX | |
| echo $MATRIX | jq . | |
| echo "::set-output name=job-strategy-matrix::$MATRIX" | |
| build-tutorials: | |
| needs: generate-job-strategy-matrix | |
| runs-on: ubuntu-latest | |
| if: ${{ needs.generate-job-strategy-matrix.outputs.job-strategy-matrix != '[]' }} | |
| strategy: | |
| matrix: ${{ fromJSON(needs.generate-job-strategy-matrix.outputs.job-strategy-matrix) }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| persist-credentials: false | |
| - name: Install Julia | |
| uses: julia-actions/setup-julia@v1 | |
| with: | |
| version: 1 | |
| - name: Build tutorial | |
| run: | | |
| bash .github/workflows/build_tutorial.sh ${{ matrix.tutorial }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: parsed/* | |
| deploy: | |
| needs: [generate-job-strategy-matrix, build-tutorials] | |
| runs-on: ubuntu-latest | |
| if: ${{ needs.generate-job-strategy-matrix.outputs.job-strategy-matrix != '[]' }} | |
| env: | |
| PAT: '${{ secrets.JSOTUTORIALS_TOKEN }}' | |
| BRANCH: 'jsotutorials-${{ github.event_name }}-${{ github.sha }}' | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: . | |
| - name: list | |
| run: ls -R | |
| - name: Clone and commit | |
| run: | | |
| git clone https://abelsiqueira:[email protected]/JuliaSmoothOptimizers/JuliaSmoothOptimizers.github.io | |
| cp -r artifact/* JuliaSmoothOptimizers.github.io/tutorials/ | |
| cd JuliaSmoothOptimizers.github.io | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "JSOTutorials bot" | |
| echo $PAT | |
| git checkout -b $BRANCH | |
| git add tutorials | |
| git commit -am ":robot: Tutorials deployment from $GITHUB_SHA" | |
| git push -u origin $BRANCH -f | |
| - name: Create pull request | |
| uses: actions/github-script@v6 | |
| with: | |
| github-token: ${{ secrets.JSOTUTORIALS_TOKEN }} | |
| script: | | |
| const { issue: { number: issue_number }, repo: { owner, repo } } = context; | |
| const { BRANCH } = process.env | |
| github.rest.pulls.create({ | |
| owner: 'JuliaSmoothOptimizers', | |
| repo: 'JuliaSmoothOptimizers.github.io', | |
| title: 'Updates from JSOTutorials', | |
| body: `Updates from ${BRANCH}`, | |
| head: `${BRANCH}`, | |
| base: 'main' | |
| }) |