Skip to content

Merge pull request #10 from machow/ci-tests #41

Merge pull request #10 from machow/ci-tests

Merge pull request #10 from machow/ci-tests #41

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches: ["main", "dev-*"]
pull_request:
release:
types: [published]
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install "git+https://github.com/posit-dev/great-tables.git@feat-interactive"
python -m pip install ".[dev]"
- uses: quarto-dev/quarto-actions/setup@v2
with:
version: "1.5.52"
- name: Build docs
run: |
make docs-build
# push to netlify -------------------------------------------------------
# set release name ----
- name: Configure pull release name
if: ${{github.event_name == 'pull_request'}}
run: |
echo "RELEASE_NAME=pr-${PR_NUMBER}" >> $GITHUB_ENV
env:
PR_NUMBER: ${{ github.event.number }}
- name: Configure branch release name
if: ${{github.event_name != 'pull_request'}}
run: |
# use branch name, but replace slashes. E.g. feat/a -> feat-a
echo "RELEASE_NAME=${GITHUB_REF_NAME/\//-}" >> $GITHUB_ENV
# deploy ----
- name: Create Github Deployment
uses: bobheadxi/[email protected]
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{ env.RELEASE_NAME }}
ref: ${{ github.head_ref }}
transient: true
logs: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Netlify docs preview
run: |
npm install -g netlify-cli
# push main branch to production, others to preview --
if [ "${ALIAS}" == "main" ]; then
netlify deploy --dir=docs/_site --alias="main"
else
netlify deploy --dir=docs/_site --alias="${ALIAS}"
fi
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
ALIAS: ${{ steps.deployment.outputs.env }}
- name: Update Github Deployment
uses: bobheadxi/[email protected]
if: ${{ always() }}
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: "https://${{ steps.deployment.outputs.env }}--react-tables-preview.netlify.app"
logs: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site