|
55 | 55 | chmod +x ./move_md_to_ugly_urls.sh |
56 | 56 | ./move_md_to_ugly_urls.sh public |
57 | 57 |
|
| 58 | + - name: Publish family Markdown to bucket root as <product>.md |
| 59 | + # The product build's home is the family landing page; serve its .md at |
| 60 | + # /<product>.md (bucket root) instead of /<product>/index.md. Skipped for the |
| 61 | + # `home` build, whose root index.md is the site landing page. |
| 62 | + if: inputs.product_family != 'home' |
| 63 | + run: | |
| 64 | + BUCKET=${{ inputs.environment == 'production' && 'reference.groupdocs.com' || 'reference2.groupdocs.com' }} |
| 65 | + aws s3 cp public/index.md "s3://$BUCKET/${{ inputs.product_family }}.md" \ |
| 66 | + --content-type "text/markdown; charset=utf-8" --region us-west-2 |
| 67 | + env: |
| 68 | + AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }} |
| 69 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS }} |
| 70 | + |
| 71 | + - name: Drop the prefixed family Markdown (served at /<product>.md instead) |
| 72 | + # Removing it locally makes `hugo deploy --maxDeletes` delete the old |
| 73 | + # /<product>/index.md from S3, so the family .md exists only at the root. |
| 74 | + if: inputs.product_family != 'home' |
| 75 | + run: rm -f public/index.md |
| 76 | + |
58 | 77 | - name: Deploy to S3 |
59 | 78 | run: hugo --configDir config/sites/groupdocs/${{ inputs.product_family }} --environment ${{ inputs.environment }} deploy --target "${{ inputs.environment == 'production' && 'Production' || 'Stage' }}" --maxDeletes ${{ inputs.max_deletes }} |
60 | 79 | env: |
|
65 | 84 | uses: chetan/invalidate-cloudfront-action@v2 |
66 | 85 | env: |
67 | 86 | DISTRIBUTION: ${{ inputs.environment == 'production' && secrets.AWS_DISTRIBUTION_PROD || secrets.AWS_DISTRIBUTION }} |
68 | | - PATHS: ${{ inputs.invalidate_paths != '' && inputs.invalidate_paths || format('/{0}/*', inputs.product_family) }} |
| 87 | + PATHS: ${{ inputs.invalidate_paths != '' && inputs.invalidate_paths || format('/{0}/* /{0}.md', inputs.product_family) }} |
69 | 88 | AWS_REGION: 'us-west-2' |
70 | 89 | AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }} |
71 | 90 | AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS }} |
0 commit comments