Skip to content

Commit

Permalink
Facilitating deployment of "review images" (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer authored May 6, 2020
1 parent e7194f6 commit a742cc0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/webviz-subsurface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: webviz-subsurface

on:
push:
branches:
- master
pull_request:
branches:
- master
Expand All @@ -15,8 +13,9 @@ on:
- cron: '0 0 * * *'

jobs:

webviz-subsurface:
# Run on all events defined above, except pushes which are neither to master nor with a substring [deploy test] in commit message
if: github.event_name != 'push' || github.ref == 'refs/heads/master' || contains(github.event.head_commit.message, '[deploy test]')
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -107,6 +106,14 @@ jobs:
echo ${{ secrets.dockerhub_webviz_token }} | docker login --username webviz --password-stdin
docker push webviz/example_subsurface_image:equinor-theme
- name: 🐳 Update review/test Docker example image
if: github.ref != 'refs/heads/master' && contains(github.event.head_commit.message, '[deploy test]') && matrix.python-version == '3.6' && matrix.pandas-version == '1.*'
run: |
docker tag webviz/example_subsurface_image:equinor-theme ${{ secrets.review_docker_registry_url }}/${{ secrets.review_container_name }}
echo ${{ secrets.review_docker_registry_token }} | docker login ${{ secrets.review_docker_registry_url }} --username ${{ secrets.review_docker_registry_username }} --password-stdin
docker push ${{ secrets.review_docker_registry_url }}/${{ secrets.review_container_name }}
- name: 🚢 Build and deploy Python package
if: github.event_name == 'release' && matrix.python-version == '3.6' && matrix.pandas-version == '1.*'
env:
Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ plugins in [webviz-config](https://github.com/equinor/webviz-config).

### Installation


The easiest way of installing this package is to run
```bash
pip install webviz-subsurface
Expand Down Expand Up @@ -58,6 +57,22 @@ pylint webviz_subsurface tests # Check code quality
bandit -r -c ./bandit.yml webviz_subsurface tests # Check Python security best practice
```

### Review of contributions

When doing review of contributions, it is usually useful to also see the resulting application live, and
not only the code changes. In order to facilitate this, this repository is using GitHub actions.

When on a feature branch, and a commit message including the substring `[deploy test]` arrives, the GitHub
action workflow will try to build and deploy a test Docker image for you (which you then can link to a web app with
e.g. automatic reload on new images). All you need to do in your own fork is to add
GitHub secrets with the following names:
- `review_docker_registry_url`: The registry to push to (e.g. `myregistry.azurecr.io`)
- `review_docker_registry_username`: Registry login username.
- `review_docker_registry_token`: Registry login token (or password).
- `review_container_name`: What you want to call the container pushed to the registry.

You are encouraged to rebase and squash/fixup unnecessary commits before pull request is merged to `master`.

### Disclaimer

This is a tool under heavy development. The current configuration file layout,
Expand Down

0 comments on commit a742cc0

Please sign in to comment.