|
6 | 6 | release: |
7 | 7 | types: [published] |
8 | 8 |
|
9 | | -env: |
10 | | - AWS_REGION: us-east-1 |
11 | | - AWS_S3_BUCKET: html-doc-pub |
12 | | - AWS_ROLE: arn:aws:iam::189079736792:role/gh-actions-html-pub |
13 | | - CANONICAL_LINK_PREFIX: https://doc.smpte-doc.org/ |
14 | | - |
15 | 9 | jobs: |
16 | 10 | build: |
17 | | - runs-on: ubuntu-latest |
18 | | - if: > |
19 | | - github.repository_owner == 'SMPTE' && ( |
20 | | - (github.event_name == 'push' && github.ref == 'refs/heads/main') |
21 | | - || github.event_name == 'pull_request' |
22 | | - || github.event_name == 'release' |
23 | | - ) |
24 | | - # These permissions are needed to interact with GitHub's OIDC Token endpoint. |
25 | 11 | permissions: |
26 | 12 | id-token: write |
27 | 13 | contents: write |
28 | 14 | pull-requests: write |
29 | | - |
30 | | - steps: |
31 | | - |
32 | | - - name: Checkout repo |
33 | | - uses: actions/checkout@v3 |
34 | | - with: |
35 | | - fetch-depth: 0 |
36 | | - submodules: true |
37 | | - |
38 | | - - name: Set repository name |
39 | | - run: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV |
40 | | - |
41 | | - - name: Check out all branches with the exception of the current branch |
42 | | - run: CUR_BRANCH=$(git rev-parse --abbrev-ref HEAD); for i in `git branch -a | grep remote | grep -v "remotes/pull" | grep -v HEAD | grep -v ${CUR_BRANCH}`; do git branch --track ${i#remotes/origin/} $i; done |
43 | | - |
44 | | - - name: Configure AWS Credentials |
45 | | - uses: aws-actions/configure-aws-credentials@v1-node16 |
46 | | - with: |
47 | | - role-to-assume: ${{ env.AWS_ROLE }} |
48 | | - aws-region: ${{ env.AWS_REGION }} |
49 | | - |
50 | | - - name: Build and deploy document (local) |
51 | | - uses: ./tooling/workflows |
52 | | - if: github.repository != 'SMPTE/html-pub' |
53 | | - with: |
54 | | - AWS_S3_REGION: ${{env.AWS_REGION}} |
55 | | - AWS_S3_BUCKET: ${{env.AWS_S3_BUCKET}} |
56 | | - AWS_S3_KEY_PREFIX: "${{env.REPOSITORY_NAME}}/" |
57 | | - CANONICAL_LINK_PREFIX: ${{env.CANONICAL_LINK_PREFIX}} |
58 | | - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
59 | | - PUBLIC_REPO_PAT: ${{secrets.PUBLIC_REPO_PAT}} |
60 | | - |
61 | | - - name: Build and deploy document (HTML Pub repo) |
62 | | - uses: ./workflows |
63 | | - if: github.repository == 'SMPTE/html-pub' |
64 | | - with: |
65 | | - AWS_S3_REGION: ${{env.AWS_REGION}} |
66 | | - AWS_S3_BUCKET: ${{env.AWS_S3_BUCKET}} |
67 | | - AWS_S3_KEY_PREFIX: "${{env.REPOSITORY_NAME}}/" |
68 | | - CANONICAL_LINK_PREFIX: ${{env.CANONICAL_LINK_PREFIX}} |
69 | | - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
70 | | - PUBLIC_REPO_PAT: ${{secrets.PUBLIC_REPO_PAT}} |
71 | | - |
72 | | - - name: Notify template repo to update submodule |
73 | | - if: github.event_name == 'release' && github.repository == 'SMPTE/html-pub' |
74 | | - env: |
75 | | - GH_TOKEN: ${{ secrets.TEMPLATE_REPO_PAT }} |
76 | | - TAG_NAME: ${{ github.event.release.tag_name }} |
77 | | - run: | |
78 | | - gh api repos/SMPTE/html-pub-template/dispatches \ |
79 | | - --method POST \ |
80 | | - --field event_type=tooling-release \ |
81 | | - --field "client_payload[tag]=${TAG_NAME}" \ |
82 | | - --field "client_payload[sha]=${GITHUB_SHA}" |
| 15 | + # Central build pipeline lives in html-pub. The build/validation code still |
| 16 | + # comes from this repo's `tooling` submodule, pinned by its SHA. Bump the |
| 17 | + # @ref to move to a new pipeline version. |
| 18 | + uses: SMPTE/html-pub/.github/workflows/build-reusable.yml@main |
| 19 | + secrets: inherit |
0 commit comments