From 10947615d423f5d9d4b2bae3755385fbae821b95 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 14 Feb 2020 14:54:48 -0500 Subject: [PATCH] github actions --- .github/workflows/build.yml | 54 +++++++++++++++++++++++++++++++++++++ README.md | 2 +- appveyor.yml | 50 ---------------------------------- 3 files changed, 55 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ed573e7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,54 @@ +name: Build + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Set up Node + uses: actions/setup-node@v1 + with: + node-version: '10.x' + + - name: Set up Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6 + + - name: Set up Jekyll + run: gem install bundler jekyll + + - name: Set up git credentials + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + env: + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + run: | + git config --global credential.helper store + echo "https://${ACCESS_TOKEN}:x-oauth-basic@github.com" >> ~/.git-credentials + git config --global user.email "ci@bitwarden.com" + git config --global user.name "Bitwarden CI" + + - name: Print environment + run: | + node --version + npm --version + ruby --version + jekyll --version + git --version + + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Install Node dependencies + run: npm install + + - name: Build site + if: github.event_name != 'push' || (github.event_name == 'push' && github.ref != 'refs/heads/master') + run: npm run build + + - name: Build site and deploy to gh-pages + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + run: npm run deploy diff --git a/README.md b/README.md index e061a25..5e03b0f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![appveyor build](https://ci.appveyor.com/api/projects/status/xmmrewrefxkq4xu7?svg=true)](https://ci.appveyor.com/project/bitwarden/docs) +[![Build](https://github.com/bitwarden/docs/workflows/Build/badge.svg)](https://github.com/bitwarden/docs/actions?query=workflow%3ABuild) [![Join the chat at https://gitter.im/bitwarden/Lobby](https://badges.gitter.im/bitwarden/Lobby.svg)](https://gitter.im/bitwarden/Lobby) # Bitwarden Docs Site diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 2104429..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,50 +0,0 @@ -image: -- Ubuntu1804 - -branches: - except: - - gh-pages - -stack: node 10, ruby 2.6 - -init: -- sh: | - if [ "${DEBUG_SSH}" == "true" ] - then - curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e - - fi - -install: -- gem install jekyll bundler -- sh: | - if [ "${GH_TOKEN}" != "" ] - then - git config --global credential.helper store - echo "https://${GH_TOKEN}:x-oauth-basic@github.com" >> ~/.git-credentials - git config --global user.email "ci@bitwarden.com" - git config --global user.name "Bitwarden CI" - fi - -before_build: -- node --version -- npm --version -- ruby --version -- jekyll --version - -build_script: -- npm install -- sh: | - if [ "${GH_TOKEN}" != "" ] - then - npm run deploy - else - npm run build - fi - -on_finish: -- sh: | - if [ "${DEBUG_SSH}" == "true" ] - then - export APPVEYOR_SSH_BLOCK=true - curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e - - fi