Skip to content

Use Github Actions to build and deploy the website #65

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 1 commit into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
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
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: build-html

on:
pull_request:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v2

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

- name: Install requirements
run: pip install -r requirements.txt

- name: Build the website
run: make all

- name: Push to genericmappingtools.github.io
if: success() && github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: GenericMappingTools/genericmappingtools.github.io
publish_branch: master
publish_dir: ./_build/html
# Only keep the latest commit to avoid bloating the repository
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
1 change: 0 additions & 1 deletion .github_deploy_key.enc

This file was deleted.

42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Source for the GMT website

[![TravisCI status](http://img.shields.io/travis/GenericMappingTools/website.svg?style=flat)](https://travis-ci.org/GenericMappingTools/website)
[![build-html](https://github.com/GenericMappingTools/website/workflows/build-html/badge.svg?event=push)](https://github.com/GenericMappingTools/website/actions?query=workflow%3Abuild-html)

This repository contains the sphinx source files for building the GMT website.

Expand All @@ -14,15 +14,12 @@ Pushing changes to
[GenericMappingTools/website](https://github.com/GenericMappingTools/website)
triggers a build on [TravisCI](https://travis-ci.org/GenericMappingTools/website).
When changes are pushed to the `master` branch (directly or by merging a Pull
Request), Travis will push the compiled site to the
Request), Github Actions will push the compiled site to the
[GenericMappingTools/genericmappingtools.github.io](https://github.com/GenericMappingTools/genericmappingtools.github.io)
repository.
Github serves this repository under
[http://genericmappingtools.github.io](http://genericmappingtools.github.io/).

Pushing the changes from Travis is handled by [doctr](https://github.com/drdoctr/doctr).
See `.travis.yml`.

See `.github/workflows/build.yml`.

## License

Expand Down
3 changes: 1 addition & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.6
- python=3.8
- pip
- sphinx
- sphinx_bootstrap_theme
- doctr
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
sphinx
sphinx_bootstrap_theme
doctr