diff --git a/.github/workflows/auto-publish.yml b/.github/workflows/auto-publish.yml index 3f63a06..b37b5cd 100644 --- a/.github/workflows/auto-publish.yml +++ b/.github/workflows/auto-publish.yml @@ -5,14 +5,50 @@ on: branches-ignore: - 'gh-pages' jobs: - main: - name: Build, Validate and Deploy + build: + name: Build and Validate runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 - - uses: w3c/spec-prod@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + - run: npm ci + - run: node --run build + - uses: actions/upload-artifact@v4 with: - GH_PAGES_BRANCH: gh-pages - TOOLCHAIN: bikeshed - SOURCE: source-map.bs - DESTINATION: ${{ github.ref_name == 'main' && 'index.html' || format('{0}/index.html', github.ref_name) }} + path: out/ + + prepare-deploy: + name: Prepare Deploy + needs: build + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + ref: gh-pages + - uses: actions/download-artifact@v4 + if: success() || failure() + - run: cp -r ./out/. . + if: github.ref_name == 'main' + - run: mkdir -p pr && cp ./out ./pr/${{ github.ref_name }} + if: github.ref_name != 'main' + - run: rm -r out + - name: Upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@v3 + with: + path: . + + deploy: + name: Deploy + needs: build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-22.04 + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/ipr.yml b/.github/workflows/ipr.yml index e9448cc..fcd71d4 100644 --- a/.github/workflows/ipr.yml +++ b/.github/workflows/ipr.yml @@ -1,4 +1,4 @@ -name: 'ecma-262' +name: IPR on: pull_request_target: @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 - run: node scripts/ipr-check.js tc39/ecma426 ${{ github.event.pull_request.head.sha || 'HEAD' }} env: