Migrate CI from TravisCI to GitHub Actions #1004
55
.github/workflows/ci.yml
vendored
Normal file
55
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
name: CI
|
||||||
|
|||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
website:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js 8
|
||||||
|
uses: actions/setup-node@v1
|
||||||
![]() AHHHH Node 8 EOL was last year. Let's at least use 10 (or 12) AHHHH Node 8 EOL was last year. Let's at least use 10 (or 12)
![]() I just copied the Travis job ¯\_(ツ)_/¯ When I tried upgrading to a more recent version of node it broke the I just copied the Travis job ¯\\\_(ツ)\_/¯
When I tried upgrading to a more recent version of node it broke the `yarn build` step :(
|
|||||||
|
with:
|
||||||
|
node-version: 8.x
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install --frozen-lockfile --ignore-scripts
|
||||||
|
working-directory: website
|
||||||
|
- name: Build
|
||||||
|
run: yarn build
|
||||||
|
working-directory: website
|
||||||
|
- name: Deploy
|
||||||
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||||
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_branch: gh-pages
|
||||||
|
publish_dir: website/public
|
||||||
![]() Why? Why?
![]() It was in Ref: It was in `.travis.yml`: `skip-cleanup: true`
Ref:
https://docs.travis-ci.com/user/deployment/pages/
https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-keeping-existing-files
|
|||||||
|
cname: yogalayout.com
|
||||||
|
keep_files: true
|
||||||
|
user_name: 'Yoga-bot'
|
||||||
|
user_email: 'yogabot@fb.com'
|
||||||
|
android:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pushd $HOME
|
||||||
|
git clone --depth 1 https://github.com/facebook/buck.git
|
||||||
|
cd buck
|
||||||
|
ant
|
||||||
|
popd
|
||||||
![]() Oh geez this is building Buck on every change… that's… wow. We probably actually need to do something different here since Buck master is diverging (but let's ignore that for now) Oh geez this is building Buck on every change… that's… wow. We probably actually need to do something different here since Buck master is diverging (but let's ignore that for now)
|
|||||||
|
echo "::set-env name=PATH::$PATH:$HOME/buck/bin/"
|
||||||
|
export PATH=$PATH:$HOME/buck/bin/
|
||||||
|
buck --version
|
||||||
|
export TERMINAL=dumb
|
||||||
|
source scripts/android-setup.sh && installAndroidSDK
|
||||||
|
echo "::set-env name=ANDROID_SDK::$ANDROID_HOME"
|
||||||
|
echo "::set-env name=ANDROID_NDK_REPOSITORY::$HOME/android-ndk"
|
||||||
|
echo "::set-env name=ANDROID_NDK_HOME::$ANDROID_NDK_REPOSITORY/android-ndk-r15c"
|
||||||
|
- name: Build
|
||||||
|
run: ./gradlew testDebugUnit && scripts/publish-snapshot.sh
|
Reference in New Issue
Block a user
We should come up with some best practice here… I almost prefer website deployment being a completely different workflow that only runs on master (so it's obvious at the workflow configuration when it runs, not needing to read this far to find out)
There's no matrix so this is a no-op I believe
I was trying to avoid writing it out twice, because for PRs it would be nice to know if the website build is broken. I'd have to copy the entire job and any changes to the build process would need to be done in two places.