Merge pull request #18 from maxmind/will/add-dependabot-cooldown #23
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: "Update Editor's Copy" | |
| on: | |
| push: | |
| branches: ["main"] | |
| paths-ignore: | |
| - README.md | |
| - CONTRIBUTING.md | |
| - LICENSE.md | |
| - .gitignore | |
| pull_request: | |
| paths-ignore: | |
| - README.md | |
| - CONTRIBUTING.md | |
| - LICENSE.md | |
| - .gitignore | |
| permissions: {} | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: "Build Drafts" | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: "Setup Ruby" | |
| uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 | |
| with: | |
| ruby-version: ruby | |
| bundler-cache: true | |
| - name: "Setup Python" | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | |
| with: | |
| python-version: "3.x" | |
| - name: "Install xml2rfc" | |
| run: pip install xml2rfc | |
| - name: "Cache xml2rfc References" | |
| uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0 | |
| with: | |
| path: .refcache | |
| key: refcache-${{ hashFiles('draft-*.md') }} | |
| restore-keys: refcache- | |
| - name: "Build Drafts" | |
| run: make | |
| - name: "Prepare Pages" | |
| env: | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| mkdir -p _site | |
| cp -f draft-*.html draft-*.txt _site/ | |
| # Generate a simple index page | |
| cat > _site/index.html <<EOF | |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>ipfeed Internet-Draft</title> | |
| <style> | |
| body { font-family: system-ui, sans-serif; max-width: 600px; margin: 4em auto; padding: 0 1em; } | |
| a { color: #2a6496; } | |
| h1 { font-size: 1.4em; } | |
| ul { line-height: 2; } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>ipfeed: Self-Published IP Network Metadata Format</h1> | |
| <ul> | |
| EOF | |
| for f in draft-*.html; do | |
| base="${f%.html}" | |
| echo " <li><a href=\"$f\">${base}</a> (<a href=\"${base}.txt\">txt</a>)</li>" >> _site/index.html | |
| done | |
| cat >> _site/index.html <<EOF | |
| </ul> | |
| <p><a href="https://github.com/${GH_REPO}">Source repository</a> · | |
| <a href="https://github.com/${GH_REPO}/issues">Issues</a></p> | |
| </body> | |
| </html> | |
| EOF | |
| - name: "Configure Pages" | |
| uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0 | |
| - name: "Upload Pages Artifact" | |
| uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 | |
| with: | |
| path: _site | |
| deploy: | |
| name: "Deploy to GitHub Pages" | |
| if: github.event_name == 'push' | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: "Deploy to GitHub Pages" | |
| id: deployment | |
| uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0 |