Skip to content

Auto deploy on push #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Deploy on push
on:
push:
branches:
- trunk
jobs:
build-and-deploy:
if: github.repository_owner == 'woocommerce'
name: Build and deploy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build
run: ./build.sh
- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target_branch: gh-pages
build_dir: build
12 changes: 0 additions & 12 deletions Gemfile

This file was deleted.

138 changes: 0 additions & 138 deletions Gemfile.lock

This file was deleted.

14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -3,3 +3,17 @@
Repository of documentation REST API WooCommerce.

This project is based on [Slate](https://github.com/tripit/slate).

## Usage ##

To generate docs run:

```bash
./build.sh
```

To deploy generated docs:

```bash
./deploy.sh
```
11 changes: 0 additions & 11 deletions Rakefile

This file was deleted.

5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -o errexit # Abort if any command fails

rm -rf build
docker run --rm --name slate -v $(pwd)/build:/srv/slate/build -v $(pwd)/source:/srv/slate/source slatedocs/slate
58 changes: 0 additions & 58 deletions config.rb

This file was deleted.

16 changes: 1 addition & 15 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -15,15 +15,8 @@ Options:
deploy branch.
-n, --no-hash Don't append the source commit's hash to the deploy
commit's message.
--source-only Only build but not push
--push-only Only push but not build
"


run_build() {
bundle exec middleman build --clean
}

parse_args() {
# Set args from a local environment file.
if [ -e ".env" ]; then
@@ -205,11 +198,4 @@ sanitize() {
"$@" 2> >(filter 1>&2) | filter
}

if [[ $1 = --source-only ]]; then
run_build
elif [[ $1 = --push-only ]]; then
main "$@"
else
run_build
main "$@"
fi
main "$@"
16 changes: 0 additions & 16 deletions lib/multilang.rb

This file was deleted.

22 changes: 0 additions & 22 deletions lib/nesting_unique_head.rb

This file was deleted.

31 changes: 0 additions & 31 deletions lib/toc_data.rb

This file was deleted.

24 changes: 0 additions & 24 deletions lib/unique_head.rb

This file was deleted.