📝 Undraft the bylaws: IP Policy #583
This file contains 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: Build PDF and publish to commonhaus.github.io | |
on: | |
pull_request: | |
paths: | |
- 'bylaws/**' | |
- 'policies/**' | |
push: | |
paths: | |
- 'agreements/**' | |
- 'bylaws/**' | |
- 'policies/**' | |
workflow_dispatch: | |
env: | |
GH_BOT_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com" | |
GH_BOT_NAME: "GitHub Action" | |
PANDOCK: ghcr.io/commonhaus/pandoc-pdf:3.1 | |
permissions: | |
contents: read | |
jobs: | |
main-root: | |
outputs: | |
is-main: ${{ steps.is-main-root.outputs.test }} | |
runs-on: ubuntu-latest | |
steps: | |
- if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'commonhaus/foundation' | |
id: is-main-root | |
run: echo "test=true" >> "$GITHUB_OUTPUT" | |
update-website: | |
needs: main-root | |
runs-on: ubuntu-latest | |
if: ${{ needs.main-root.outputs.is-main }} | |
permissions: | |
actions: read | |
steps: | |
- name: Bump website | |
env: | |
GH_TOKEN: ${{ secrets.ACTIONS_PUBLISH_PAT }} | |
run: | | |
gh workflow run -R commonhaus/commonhaus.github.io push-content.yml | |
package: | |
name: Package PDFs | |
needs: main-root | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
actions: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: convert md to pdf | |
if: ${{ needs.main-root.outputs.is-main || github.event_name == 'pull_request' }} | |
env: | |
GIT_COMMIT: ${{ github.sha }} | |
GH_TOKEN: ${{ github.token }} | |
IS_PR: ${{ github.event_name == 'pull_request' }} | |
run: ./.github/docker-build-pdf.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pdf-output | |
path: output/public/*.pdf | |
- name: Update snapshot tag | |
if: ${{ needs.main-root.outputs.is-main }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
shell: bash | |
run: | | |
git config user.name ${{ env.GH_BOT_NAME }} | |
git config user.email ${{ env.GH_BOT_EMAIL }} | |
echo "Update tag for SNAPSHOT" | |
git push origin :refs/tags/SNAPSHOT | |
git tag -f SNAPSHOT | |
git push --tags | |
echo "Update SNAPSHOT release" | |
gh release upload SNAPSHOT --clobber output/public/* | |
# These must be done separately to correctly toggle draft flag | |
gh release edit SNAPSHOT -t "PDF snapshot" --prerelease | |
gh release view SNAPSHOT | |
gh release edit SNAPSHOT --draft=false |