Skip to content

Commit bcacaa9

Browse files
committed
Use Dependabot to check that the base image is up to date
Extends #18 with Dependabot checking the base image to make sure it is up to date weekly. Github actions checks each push to make sure the image can be build, launched, and will return a 200 from the default ERDDAP page. When a commit is to the main or master branch, then the built image will be pushed to Docker Hub (if appropriate secrets are setup, and it is to Axiom's repo).
1 parent 129a846 commit bcacaa9

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: docker
4+
directory: "/"
5+
schedule:
6+
interval: weekly

.github/workflows/push.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Push
2+
3+
on: [push, workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
name: Build and test Docker Image
8+
runs-on: ubuntu-20.04
9+
timeout-minutes: 10
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v1
14+
15+
- name: Cache Docker Layers
16+
uses: satackey/action-docker-layer-caching@v0.0.11
17+
continue-on-error: true
18+
19+
- name: Login to Docker Hub
20+
uses: azure/docker-login@v1
21+
continue-on-error: true
22+
with:
23+
username: ${{ secrets.DOCKER_USERNAME }}
24+
password: ${{ secrets.DOCKER_PASSWORD }}
25+
26+
- name: Build Docker Image
27+
run: docker build --tag axiom/docker-erddap:latest .
28+
29+
- name: Run Docker Image in Background
30+
run: docker run -d -p 8080:8080 axiom/docker-erddap:latest
31+
32+
- name: Check that ERDDAP Docker Image will return a 200
33+
uses: ifaxity/wait-on-action@v1
34+
timeout-minutes: 1
35+
with:
36+
resource: http://localhost:8080/erddap/index.html
37+
38+
push:
39+
name: Push latest image to Docker Hub
40+
runs-on: ubuntu-20.04
41+
timeout-minutes: 10
42+
needs: build
43+
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && github.repository == 'axiom-data-science/docker-erddap'
44+
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v1
48+
49+
- name: Cache Docker Layers
50+
uses: satackey/action-docker-layer-caching@v0.0.11
51+
52+
- name: Login to Docker Hub
53+
uses: azure/docker-login@v1
54+
with:
55+
username: ${{ secrets.DOCKER_USERNAME }}
56+
password: ${{ secrets.DOCKER_PASSWORD }}
57+
58+
- name: Push latest image to Docker Hub if on master or main branch of Axiom's repo
59+
run: docker push axiom/docker-erddap:latest

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ This repository will **not** back-port changes from the upstream image to existi
1717
(for example - SHA512 password hashes) you will have to wait for the next ERDDAP release which will be built with the newest upstream image.
1818
You can also build this image yourself.
1919

20+
Use `latest` image with caution as it follows the upstream image, and is not as thoroughly tested as tagged images.
21+
22+
[Dependabot](https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/keeping-your-dependencies-updated-automatically) is used to automatically make PRs to update the upstream image ([`.github/dependabot.yml`](.github/dependabot.yml)).
23+
2024
## Quickstart
2125

2226
```bash

0 commit comments

Comments
 (0)