Skip to content

Commit

Permalink
improve: production versions for GHA and docker-compose files
Browse files Browse the repository at this point in the history
* GHA: only build when a tag beginning with "v" is pushed, drop development builds on every push to master/main/this PR branch
* docker-compose: use what I think could be the official GetODK image names, but final naming is up to the core team
* docker image versions: currently referring to "latest" for ease of testing, should be pinned before used in prod
  • Loading branch information
Florian Mayer authored and Florian Mayer committed Feb 13, 2022
1 parent da53c14 commit a40b62d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
# Publish `v1.2.3` tags as releases.

# This GitHub Action runs whenever a git tag beginning with "v" is pushed. E.g., "v0.4.0".
on:
push:
tags:
- v*
# DEBUG: once working in upstream, drop the branches.
branches:
- main
- master
- '272-docker'

name: docker

Expand All @@ -32,7 +29,7 @@ jobs:
run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"

- name: Log in to registry
# This is where you will update the PAT to GITHUB_TOKEN
# Instead of a PAT, a GITHUB_TOKEN can be used
run: echo "${{ secrets.GH_PAT }}" | docker login ghcr.io -u ${{ secrets.GH_ACTOR }} --password-stdin

- name: Push image
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ services:
POSTGRES_DATABASE: odkbuild
restart: always
build2xlsform:
# image: "ghcr.io/getodk/build2xlsform:latest"
image: "ghcr.io/florianm/odkbuild2xlsform:21-docker"
image: "ghcr.io/getodk/build2xlsform:latest"
ports:
- "8686:8686"
odkbuild:
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ services:
POSTGRES_DATABASE: odkbuild
restart: always
build2xlsform:
# image: "ghcr.io/getodk/build2xlsform:latest"
image: "ghcr.io/florianm/odkbuild2xlsform:21-docker"
image: "ghcr.io/getodk/build2xlsform:latest"
ports:
- "8686:8686"
odkbuild:
Expand Down

0 comments on commit a40b62d

Please sign in to comment.