Skip to content

Commit

Permalink
Fix double triggers of workflows, add spacing to steps (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiebergman authored Jan 26, 2022
1 parent 4d69931 commit 61d7259
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 4 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,61 @@
name: Docs
on: [pull_request, push]

on:

# Trigger manually
workflow_dispatch:

# Trigger on any push to the master
push:
branches:
- master

# Trigger on any push to a PR that targets master
pull_request:
branches:
- master

jobs:

build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
pip install -e .[docs,examples,examples_unix]
- name: Make docs
run: |
cd docs
make html
- name: Run doctests
run: |
cd docs
make doctest
- name: Pull latest gh-pages
if: (contains(github.ref, 'master')) && github.event_name == 'push'
run: |
cd ..
git clone https://github.com/automl/ConfigSpace.git --branch gh-pages --single-branch gh-pages
- name: Copy new docs into gh-pages
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
run: |
branch_name=${GITHUB_REF##*/}
cd ../gh-pages
rm -rf $branch_name
cp -r ../ConfigSpace/docs/build/html $branch_name
- name: Push to gh-pages
if: (contains(github.ref, 'master')) && github.event_name == 'push'
run: |
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
name: pre-commit

on: [push, pull_request]
on:

# Trigger manually
workflow_dispatch:

# Trigger on any push to the master
push:
branches:
- master

# Trigger on any push to a PR that targets master
pull_request:
branches:
- master

jobs:

run-all-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install pre-commit
run: |
pip install pre-commit
pre-commit install
- name: Run pre-commit
run: |
pre-commit run --all-files

0 comments on commit 61d7259

Please sign in to comment.