diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..5bab49a44 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,29 @@ +name: CI +on: + push: + branches: + - master + pull_request: + +jobs: + ci: + name: CI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Cache cargo + uses: actions/cache@v1 + with: + path: target + key: cargo-build-${{ hashFiles('**/Cargo.lock') }} + restore-key: cargo-build- + - name: Build Blog + run: cargo run + - name: Deploy to GitHub Pages + run: | + cp CNAME ./site/ + curl -LsSf https://raw.githubusercontent.com/rust-lang/simpleinfra/master/setup-deploy-keys/src/deploy.rs | rustc - -o /tmp/deploy + (cd site/ && /tmp/deploy) + env: + GITHUB_DEPLOY_KEY: ${{ secrets.GITHUB_DEPLOY_KEY }} + if: github.ref == 'refs/heads/master' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bac5ab22f..000000000 --- a/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: rust -rust: 1.31.1 -cache: cargo -script: - - cargo run -after_success: - - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && bash deploy.sh diff --git a/deploy.sh b/deploy.sh deleted file mode 100644 index a72be110f..000000000 --- a/deploy.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -set -o errexit -o nounset - -if [ "$TRAVIS_BRANCH" != "master" ] -then - echo "This commit was made against the $TRAVIS_BRANCH and not the master! No deploy!" - exit 0 -fi - -rev=$(git rev-parse --short HEAD) - -cd site - -git init -git config user.name "Steve Klabnik" -git config user.email "steve@steveklabnik.com" - -git remote add upstream "https://$GH_TOKEN@github.com/rust-lang/blog.rust-lang.org.git" -git fetch upstream -git reset upstream/gh-pages - -touch . - -cp ../CNAME . - -git add -A . -git commit -m "rebuild pages at ${rev}" -git push -q upstream HEAD:gh-pages