Skip to content

Commit

Permalink
Merge pull request #5 from internetstandards/ghcr
Browse files Browse the repository at this point in the history
Ghcr
  • Loading branch information
aequitas authored Nov 7, 2024
2 parents 7b8828e + b6b3dbe commit 3a328d3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 24 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,16 @@ jobs:
run: make lint

- name: test
run: make test
run: make up test rm

- name: Login to Docker Hub
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/login-action@v2
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push image to docker hub
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
make push_images
env:
DOCKER_USERNAME: internetstandards
secure: U7kSLhWutEWne8w0zMUN3XzWWWHnK0NKuDxrKQBtYpH5VA+ROd0js7y9uFYflqdJO/doiXE4updVM8D1aGrxfJ8Wp2Ywp5vC/6Ua+Wn+pdIi2WNBqOgCeq3+2NUMND7DpChFIA9dBiEOCnnOlRKYaz5bBhOR7trruV2E+QSCG+Scxejg+pToF/cRsQDI9zTktAr9rfWDfOjz0jfxC2NixOP8THFZhDW/vXlRWWGtmwvnawwXMdyhRYnIV/fvb2RnHeVlDXckMm+GTEcRwKZTp1Cy/lCuk8zEzxPkSvrYnAeC8Dto/KPFo9XnRNKNPygf4t7YlJ8eGvw7sp5QKH327D8+1kjspq20Aqq7IoHSHnhmYGrJSsgmoWsod6Be8PaFV/FjjfDbMvcpNspVxSPQu/h0P0POdK3+0HJBQ0j1qaYlOwlKGFyoNEN+hPOg7A/RWeV+P5wn5SxZCepL4T95uS4JIsb7SMmD1GxRTr+6ygRrKOnduBtBXFV48LALxvAwvBTka9muo924HDNsRQiI0r5gizoNPPTw+T8tzynoc7QRalih03UnEVvRxuPPz+kF+GyXQYLjVRIuPlrubnprOuW31VYEgwzAv32Ec3OZoUvx6MQvSvsignklSJgg9pucMu6apQPNkyt8GPRgUKUqQscPY1mSMhblWnaPAu7my9w=
20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
SHELL = /bin/bash

ctlssa = docker compose exec -ti app
dev = docker compose --profile=dev run -i --rm dev
db = docker compose exec -i db

# run this before/after checking in/out the source
all: build lint test
all: build lint up test

# run the entire project
run up:
run:
docker compose up --remove-orphans --watch

up:
docker compose up --remove-orphans --detach

down:
docker compose down --remove-orphans

rm:
docker compose rm --force --stop

# make migration files
makemigrations:
${dev} "ctlssa makemigrations"
${ctlssa} "ctlssa makemigrations"

# load testdatta fixture
testdata:
${dev} "ctlssa loaddata testdata"
${ctlssa} "ctlssa loaddata testdata"

# run development shell
dev dev-shell shell:
Expand Down Expand Up @@ -62,7 +72,7 @@ build:
docker compose build ${build_args}

push_images:
docker compose --push app certstream
docker compose push app certstream

# remove all runtime state and cache from the project
mrproper:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ Run these commands before checking in. These should all pass without error.

To run the test suite use:

make build test
make build up test

To rerun tests every time a file changes use:

make build test-watch
make build up test-watch

### Development shell

Expand Down
13 changes: 5 additions & 8 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
services:
app:
image: internetstandards/ctlssa:latest
image: ghcr.io/internetstandards/ctlssa:latest
build: &app_build
context: .
cache_from:
- internetstandards/ctlssa:latest
- ghcr.io/internetstandards/ctlssa:latest
- type=gha
cache_to:
- type=gha
Expand Down Expand Up @@ -45,7 +45,7 @@ services:
app-ingest:
build: *app_build
develop: *app_develop
image: internetstandards/ctlssa:latest
image: ghcr.io/internetstandards/ctlssa:latest
environment:
CTLSSA_SECRET_KEY: '1'
CTLSSA_DJANGO_DATABASE: production
Expand All @@ -71,7 +71,7 @@ services:
certstream:
build:
context: vendor/certstream
image: internetstandards/certstream
image: ghcr.io/internetstandards/certstream:latest
environment:
LOG_LEVEL: error
restart: always
Expand Down Expand Up @@ -100,7 +100,7 @@ services:
db-migrate:
build: *app_build
develop: *app_develop
image: internetstandards/ctlssa:latest
image: ghcr.io/internetstandards/ctlssa:latest
restart: on-failure
environment:
CTLSSA_SECRET_KEY: '1'
Expand All @@ -124,9 +124,6 @@ services:
volumes:
- .:/src
- ./.root:/root
depends_on:
app:
condition: service_healthy

profiles:
- dev
Expand Down

0 comments on commit 3a328d3

Please sign in to comment.