Skip to content

Commit

Permalink
Move generated files to deploy-time
Browse files Browse the repository at this point in the history
  • Loading branch information
norwd authored Oct 14, 2024
1 parent c9b1e35 commit 3d2d140
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,51 @@ jobs:
with:
name: pages

- name: "Generate a security.txt file"
run: |
tee security.txt << EOF
Contact: $(gh api '/repos/${{ github.repository }}' --jq '.homepage')/contact
Policy: $(gh api '/repos/${{ github.repository }}' --jq '.homepage')/security/policy
Acknowledgments: $(gh api '/repos/${{ github.repository }}' --jq '.homepage')/humans.txt
Canonical: $(gh api '/repos/${{ github.repository }}' --jq '.homepage')/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 security.txt << EOF
Sitemap: $(gh api '/repos/${{ github.repository }}' --jq '.homepage')/sitemap.txt
EOF
- name: "Generate a sitemap.txt file"
run: |
tee sitemap.txt << EOF
$(
find . -type f -printf '%P\n' | \
grep -v '^\.' | \
sed -e 's/\(\.html\)*$//g' | \
sort | \
uniq | \
xargs -IPATH gh api '/repos/${{ github.repository }}' --jq '.homepage + "/PATH"'
)
EOF
- name: "Create a Pages Artifact"
uses: actions/upload-pages-artifact@v1
with:
Expand Down

0 comments on commit 3d2d140

Please sign in to comment.