blob: 757380909d0071d56a5d7abba5d95c7754b677a7 [file] [log] [blame]
on:
push:
branches:
- main
name: Deploy development Cookbooks
jobs:
make_dev_cookbooks:
name: build
runs-on: ubuntu-latest
env:
ARROW_NIGHTLY: 1
steps:
- uses: actions/checkout@v3
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt install libcurl4-openssl-dev \
libidn2-dev \
libkrb5-dev \
libldap-dev \
libnghttp2-dev \
libpsl-dev \
librtmp-dev \
libssh-dev \
libssh2-1-dev \
libssl-dev \
maven \
openjdk-11-jdk \
python3-pip
- name: Run tests
run: make test
- name: Build and render books
run: make all
- name: Upload book artifact
uses: actions/upload-artifact@v3
with:
name: build_book
path: build/
make_dev_cpp:
name: build c++
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- name: Cache conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if cpp/dev.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('cpp/dev.yml') }}
- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.9
activate-environment: cookbook-cpp-dev
environment-file: cpp/dev.yml
auto-activate-base: false
- name: Test
run:
echo ${CONDA_PREFIX}
- name: Build cookbook
run:
make cpp
- name: Upload cpp book
uses: actions/upload-artifact@v3
with:
name: cpp_book
path: build/cpp
deploy_dev_cookbooks:
name: deploy
runs-on: ubuntu-latest
needs: [make_dev_cookbooks, make_dev_cpp]
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
ref: gh-pages
- name: Prepare branch
run: |
git checkout --orphan gh-pages-tmp
git rm -rf --ignore-unmatch ./dev
mkdir dev
- name: Download book artifact
uses: actions/download-artifact@v1.0.0
with:
name: build_book
path: ./dev
- name: Download cpp book
uses: actions/download-artifact@v1.0.0
with:
name: cpp_book
path: ./dev/cpp
- name: Push changes to gh-pages/asf-site branch
run: |
mv -f dev/index_dev.html dev/index.html
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git add --all
git commit -m 'publish built book'
git push -f origin gh-pages-tmp:gh-pages
git push -f origin gh-pages-tmp:asf-site