|
| 1 | +on: [workflow_dispatch] |
| 2 | + |
| 3 | +name: GitHub Actions for pandoc |
| 4 | +jobs: |
| 5 | + pandoc: |
| 6 | + runs-on: ubuntu-latest |
| 7 | + name: nbconvert |
| 8 | + steps: |
| 9 | + - name: checkout repo |
| 10 | + uses: actions/checkout@v3 |
| 11 | + |
| 12 | + - name: deleting pandoc branch if exists |
| 13 | + shell: bash |
| 14 | + run: | |
| 15 | + git push origin -d pandoc &>/dev/null || true |
| 16 | + |
| 17 | + - name: extracting branch name & creating the new pandoc branch |
| 18 | + shell: bash |
| 19 | + run: | |
| 20 | + echo "GitHub reft_name ${{ github.ref_name }}" |
| 21 | + git checkout -b pandoc |
| 22 | + git push -u origin pandoc |
| 23 | + id: extract_branch |
| 24 | + - name: retreiving name of the article |
| 25 | + id: getfile |
| 26 | + run: | |
| 27 | + FIRST_FILE=$(ls *.ipynb | sort | head -n 1 | sed -e 's/\.ipynb$//') |
| 28 | + echo "FIRST_IPYNB_FILE=$FIRST_FILE" >> $GITHUB_ENV |
| 29 | + - name: pandoc convertion to docx |
| 30 | + uses: docker://pandoc/latex:2.9 |
| 31 | + with: |
| 32 | + args: --output=${{ env.FIRST_IPYNB_FILE }}.docx ${{ env.FIRST_IPYNB_FILE }}.ipynb |
| 33 | + |
| 34 | + - name: committing changes |
| 35 | + uses: stefanzweifel/git-auto-commit-action@v5 |
| 36 | + with: |
| 37 | + commit_message: Automated commit |
| 38 | + branch: pandoc |
| 39 | + create_branch: true |
| 40 | + - name: Send mail |
| 41 | + uses: dawidd6/action-send-mail@v3 |
| 42 | + with: |
| 43 | + # Specify connection via URL (replaces server_address, server_port, secure, |
| 44 | + # username and password) |
| 45 | + # |
| 46 | + # Format: |
| 47 | + # |
| 48 | + # * smtp://user:password@server:port |
| 49 | + # * smtp+starttls://user:password@server:port |
| 50 | + # connection_url: 'smtp://[email protected]:"soes wbsg snpk rqno"@smtp.gmail.com:465' |
| 51 | + # Required mail server address if not connection_url: |
| 52 | + server_address: smtp.gmail.com |
| 53 | + # # Server port, default 25: |
| 54 | + server_port: 465 |
| 55 | + # Optional whether this connection use TLS (default is true if server_port is 465) |
| 56 | + # secure: true |
| 57 | + # # Optional (recommended) mail server username: |
| 58 | + |
| 59 | + # # Optional (recommended) mail server password: |
| 60 | + password: soes wbsg snpk rqno |
| 61 | + # Required mail subject: |
| 62 | + subject: test email from github actions |
| 63 | + # Required recipients' addresses: |
| 64 | + |
| 65 | + # Required sender full name (address can be skipped): |
| 66 | + from: Aboba Boba # <[email protected]> |
| 67 | + # Optional plain body: |
| 68 | + body: hello from github actions |
| 69 | + # # Optional HTML body read from file: |
| 70 | + # html_body: file://README.html |
| 71 | + # Optional carbon copy recipients: |
| 72 | + |
| 73 | + # # Optional blind carbon copy recipients: |
| 74 | + |
| 75 | + # Optional recipient of the email response: |
| 76 | + |
| 77 | + # Optional unsigned/invalid certificates allowance: |
| 78 | + ignore_cert: true |
| 79 | + # # Optional converting Markdown to HTML (set content_type to text/html too): |
| 80 | + # convert_markdown: true |
| 81 | + # # Optional attachments: |
| 82 | + # attachments: attachments.zip,git.diff,./dist/static/*.js |
| 83 | + # Optional priority: 'high', 'normal' (default) or 'low' |
| 84 | + priority: normal |
0 commit comments