|
| 1 | +name: Compile vterron.xyz/classes Beamer slides to PDF |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +env: |
| 6 | + BASENAME: python-classes |
| 7 | + WORKING_DIR: "[2014] Classes in Python: You're Doing it Wrong" |
| 8 | + |
| 9 | +jobs: |
| 10 | + build_job: |
| 11 | + name: Build PDF slides |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Git repository checkout |
| 16 | + uses: actions/checkout@v2 |
| 17 | + |
| 18 | + - name: Install Python 2 |
| 19 | + uses: actions/setup-python@v2 |
| 20 | + with: |
| 21 | + python-version: '2.7.18' |
| 22 | + |
| 23 | + - name: Install pdfLaTeX |
| 24 | + run: sudo apt-get install -y texlive-latex-extra |
| 25 | + |
| 26 | + - name: LaTeX compilation |
| 27 | + working-directory: ${{ env.WORKING_DIR }} |
| 28 | + run: make pdf |
| 29 | + |
| 30 | + # In upload-artifact action below we can't upload an artifact whose path includes a colon. |
| 31 | + - name: Move PDF artifact to Git repository root directory. |
| 32 | + working-directory: ${{ env.WORKING_DIR }} |
| 33 | + run: mv ${{ env.BASENAME }}.pdf .. -v |
| 34 | + |
| 35 | + - name: Upload PDF artifact |
| 36 | + uses: actions/upload-artifact@v2 |
| 37 | + with: |
| 38 | + name: slides-pdf |
| 39 | + path: ${{ env.BASENAME }}.pdf |
| 40 | + if-no-files-found: error |
| 41 | + |
| 42 | + upload_job: |
| 43 | + name: Upload PDF slides |
| 44 | + needs: build_job |
| 45 | + runs-on: ubuntu-latest |
| 46 | + |
| 47 | + steps: |
| 48 | + - name: Configure AWS credentials |
| 49 | + uses: aws-actions/configure-aws-credentials@v1 |
| 50 | + with: |
| 51 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 52 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 53 | + aws-region: ${{ secrets.AWS_REGION }} |
| 54 | + |
| 55 | + - name: Download PDF artifact |
| 56 | + uses: actions/download-artifact@v2 |
| 57 | + with: |
| 58 | + name: slides-pdf |
| 59 | + |
| 60 | + - name: Upload PDF slides to Amazon S3 |
| 61 | + run: | |
| 62 | + aws s3 cp ${{ env.BASENAME }}.pdf ${{ secrets.AWS_S3_BUCKET }} |
0 commit comments