diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d30e2e6..134ebdf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,8 @@ name: Deploy Demo Site -on: +on: push: - branches: + branches: - master jobs: @@ -10,11 +10,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1.1.0 + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '12' - run: npm install - run: npm run build - run: npm install -g surge - run: surge --domain unofficial-observablehq-compiler-demo.surge.sh --project . - env: + env: SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 4be180a..407e60c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,6 +1,6 @@ name: Pull Request Demos -on: +on: pull_request: types: [opened, reopened, synchronize] @@ -9,19 +9,21 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1.1.0 + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '12' - run: npm install - run: npm run build - run: npm install -g surge - run: surge --domain unofficial-observablehq-compiler-demo-${{ github.event.number }}.surge.sh --project . - env: + env: SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} - - uses: actions/github-script@0.2.0 + - uses: actions/github-script@v3 with: - github-token: ${{github.token}} + github-token: ${{ secrets.GITHUB_TOKEN }} script: | - await github.issues.createComment({ + github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo,