|
1 | | -name: GitHub Actions Demo |
2 | | -run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 |
3 | | -on: [workflow_dispatch] |
| 1 | +name: Deploy Pages |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - "main" |
| 9 | + paths: |
| 10 | + - "docs/**" |
| 11 | + - mkdocs.yml |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + pages: write |
| 16 | + id-token: write |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: "pages" |
| 20 | + cancel-in-progress: true |
| 21 | + |
4 | 22 | jobs: |
5 | | - Explore-GitHub-Actions: |
| 23 | + build: |
6 | 24 | runs-on: ubuntu-latest |
7 | 25 | steps: |
8 | | - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." |
9 | | - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" |
10 | | - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." |
11 | | - - name: Check out repository code |
12 | | - uses: actions/checkout@v4 |
13 | | - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." |
14 | | - - run: echo "🖥️ The workflow is now ready to test your code on the runner." |
15 | | - - name: List files in the repository |
16 | | - run: | |
17 | | - ls ${{ github.workspace }} |
18 | | - - run: echo "🍏 This job's status is ${{ job.status }}." |
| 26 | + - name: Checkout |
| 27 | + uses: actions/checkout@v3 |
| 28 | + - run: ls -la |
| 29 | + - name: Setup Pages |
| 30 | + uses: actions/configure-pages@v2 |
| 31 | + - name: Setup Python, install plugins, and build site |
| 32 | + uses: actions/setup-python@v4 |
| 33 | + with: |
| 34 | + python-version: 3.x |
| 35 | + - run: pip install mkdocs |
| 36 | + - run: pip install mkdocs-section-index |
| 37 | + - run: mkdocs build --site-dir ./_site |
| 38 | + - name: Upload artifact |
| 39 | + uses: actions/upload-pages-artifact@v1 |
| 40 | + |
| 41 | + deploy: |
| 42 | + environment: |
| 43 | + name: github-pages |
| 44 | + url: ${{ steps.deployment.outputs.page_url }} |
| 45 | + runs-on: ubuntu-latest |
| 46 | + needs: build |
| 47 | + steps: |
| 48 | + - name: Deploy to GitHub Pages |
| 49 | + id: deployment |
| 50 | + uses: actions/deploy-pages@v1 |
0 commit comments