Skip to content

Commit

Permalink
pdf upload behavior for branches
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Jan 11, 2024
1 parent 6accf88 commit da8ce25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/docker-build-pdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,4 @@ to_policy_pdf succession-plan "Continuity and Administrative Access"
to_policy_pdf trademark-policy "Trademark"

# TODO: to_policy_pdf privacy "Privacy"
ls -al output/public
21 changes: 9 additions & 12 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
env:
GH_BOT_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
GH_BOT_NAME: "GitHub Action"
MAIN_REPO: ${{ github.ref == 'refs/heads/main' && github.repository == 'commonhaus/foundation-draft' }}
PANDOCK: ebullient/pandoc-emoji:3.1

jobs:
Expand Down Expand Up @@ -79,32 +78,30 @@ jobs:
IS_PR: ${{ github.event_name == 'pull_request' }}
run: ./.github/docker-build-pdf.sh

- uses: actions/upload-artifact@v3
if: ${{ ! env.MAIN_REPO }}
- uses: actions/upload-artifact@v4
if: ${{ github.ref != 'refs/heads/main' }}
with:
name: output
path: output/public

- name: Git Config
run: |
git config user.name ${{ env.GH_BOT_NAME }}
git config user.email ${{ env.GH_BOT_EMAIL }}
name: pdf-output
path: output/public/*.pdf

- name: Update snapshot tag
if: ${{ env.MAIN_REPO }}
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'commonhaus/foundation-draft' }}
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 edit SNAPSHOT --draft=false
gh release view SNAPSHOT

0 comments on commit da8ce25

Please sign in to comment.