Skip to content

Commit

Permalink
Simplify deployment (#80)
Browse files Browse the repository at this point in the history
<!-- LIST CHANGES HERE -->
  • Loading branch information
norwd authored Jan 5, 2025
2 parents cb949a1 + a3d3919 commit 9807fc3
Showing 1 changed file with 15 additions and 23 deletions.
38 changes: 15 additions & 23 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@ jobs:
- id: configure-pages
name: "Setup Pages"
uses: actions/configure-pages@v5


- name: "Setup Environment"
run: |
tee "${GITHUB_ENV}" << EOF
BASE_URL=${{ steps.configure-pages.outputs.base_url }}
PAGES_ORIGIN=${{ steps.configure-pages.outputs.origin }}
PAGES_HOST=${{ steps.configure-pages.outputs.host }}
BASE_PATH=${{ steps.configure-pages.outputs.base_path }}
EOF
- name: "Unarchive Pages Artifact"
uses: actions/download-artifact@v4
with:
Expand All @@ -51,37 +60,21 @@ jobs:
- name: "Generate a security.txt file"
run: |
tee security.txt << EOF
Contact: ${{ steps.configure-pages.outputs.base_url }}/contact
Policy: ${{ steps.configure-pages.outputs.base_url }}/security/policy
Acknowledgments: ${{ steps.configure-pages.outputs.base_url }}/humans.txt
Canonical: ${{ steps.configure-pages.outputs.base_url }}/security.txt
Contact: ${BASE_URL}/contact
Policy: ${BASE_URL}/security/policy
Acknowledgments: ${BASE_URL}/humans
Canonical: ${BASE_URL}/security.txt
Expires: $(date -u +"%Y-12-31T23:59:59.999Z")
EOF
- name: "Generate a humans.txt file"
run: gh api "${ENDPOINT}" --template "${TEMPLATE}" | sh | tee humans.txt
env:
ENDPOINT: '/orgs/${{ github.repository_owner }}/repos'
TEMPLATE: |
echo "# Contributors by Repository"
echo
echo "A huge thanks to all and colaborators who have contributed on GitHub!"
echo
{{range .}}
echo "## {{.full_name}}"
echo
gh api '/repos/{{.full_name}}/contributors' --jq '.[].login' | sort -u | xargs -ILOGIN gh api '/users/LOGIN' --jq '"- @" + .login + " (" + (.name // .login) + ")"'
echo
{{end}}
- name: "Generate a robots.txt file"
run: |
tee robots.txt << EOF
# Block AI Crawlers (see: https://github.com/ai-robots-txt)
$(gh release download --repo ai-robots-txt/ai.robots.txt --pattern 'robots.txt' --output -)
# List of pages and files
Sitemap: ${{ steps.configure-pages.outputs.base_url }}/sitemap.txt
Sitemap: ${BASE_URL}/sitemap.txt
EOF
- name: "Generate a version.txt file"
Expand All @@ -93,7 +86,6 @@ jobs:
EOF
- name: "Generate a sitemap.txt file"
env: { BASE_URL: '${{ steps.configure-pages.outputs.base_url }}' }
run: |
touch sitemap.txt # this ensures that the sitemap detects itself
find . -type f -printf "${BASE_URL}/%P\n" | sed -e 's/\(\.html\)*$//g' | sort --unique | tee -a sitemap.txt
Expand Down

0 comments on commit 9807fc3

Please sign in to comment.