core-aam #7
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 and Deploy Editor's Drafts | |
on: | |
push: | |
branches: [$default-branch] | |
workflow_dispatch: | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
if: github.repository == 'daniel-montalvo/aria' | |
strategy: | |
matrix: | |
spec: | |
- name: 'accname' | |
branch: 'gh-pages' | |
repo: daniel-montalvo/accname | |
- name: core-aam | |
branch: 'gh-pages' | |
repo: daniel-montalvo/core-aam | |
# Others to come | |
steps: | |
- name: Checkout monorepo | |
uses: actions/checkout@v4 | |
- name : Checkout deployment repositories | |
uses: actions/checkout@v4 | |
with: | |
repository: w3c/${{ matrix.spec.repo }} | |
ref: ${{ matrix.spec.branch }} | |
path: w3c/${{ matrix.spec.repo }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '>20.1.1' | |
- name: Install ReSpec | |
run: npm install -g respec@latest | |
- name: Build Respec | |
run: npx respec --src ${{ matrix.spec.name }}/index.html --out ${{ matrix.spec.name }}/Overview.html | |
- name : Copy files | |
run: | | |
cp ./${{ matrix.spec.name }}/Overview.html ${{ matrix.spec.repository }}Overview.html | |
cp -r ./common/* ${{ matrix.spec.repository }}/common/* | |
- name: Push changes | |
run: | | |
cd ${{ matrix.spec.repository }} | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Update ${{ matrix.spec.name }} -m Generated by https://github.com/w3c/aria/commit/${{ github.sha }}" || true | |
git push |