From 8d017072ce2b2d7f845f6bd302079b50b490b640 Mon Sep 17 00:00:00 2001 From: Geoff Natin Date: Fri, 26 May 2023 13:17:21 +0100 Subject: [PATCH] #115 Add GitHub actions for testing/deploying PRs when pushed/merged --- .github/workflows/deploy.yml | 33 +++++++++++++++++++++++++++++++ .github/workflows/test-deploy.yml | 25 +++++++++++++++++++++++ .travis.yml | 14 ------------- 3 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/test-deploy.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..5884a8ef --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,33 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - master + +jobs: + deploy: + name: Deploy to GitHub Pages + runs-on: ubuntu-latest + defaults: + run: + working-directory: website + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: yarn + + - name: Install dependencies + run: yarn install --frozen-lockfile + - name: Build website + run: yarn build + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build + user_name: github-actions[bot] + user_email: 41898282+github-actions[bot]@users.noreply.github.com diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml new file mode 100644 index 00000000..a46c2548 --- /dev/null +++ b/.github/workflows/test-deploy.yml @@ -0,0 +1,25 @@ +name: Test deployment + +on: + pull_request: + branches: + - master + +jobs: + test-deploy: + name: Test deployment + runs-on: ubuntu-latest + defaults: + run: + working-directory: website + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: yarn + + - name: Install dependencies + run: yarn install --frozen-lockfile + - name: Test build website + run: yarn build diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 576b7ffa..00000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: node_js -node_js: - - '16.16.0' -branches: - only: - - master -cache: - yarn: true -script: - - cd website - - git config --global user.name "${GH_NAME}" - - git config --global user.email "${GH_EMAIL}" - - echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc - - yarn && GIT_USER="${GH_NAME}" yarn deploy