Skip to content

Commit cae9ac9

Browse files
committed
ci: publish docker images
closes #5
1 parent add5630 commit cae9ac9

File tree

3 files changed

+77
-7
lines changed

3 files changed

+77
-7
lines changed

.github/workflows/cicd.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name: CI/CD
22

33
on:
4-
- push
4+
push:
5+
branches: [ "main" ]
6+
release:
7+
types: [ published ]
58

69
jobs:
710
lint:

.github/workflows/publish-docker.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Publish Docker image
2+
3+
on:
4+
workflow_run:
5+
workflows: ["CI/CD"]
6+
types:
7+
- completed
8+
branches:
9+
- main
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: ${{ github.repository }}
14+
15+
jobs:
16+
build-and-push:
17+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Log in to the Container registry
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ${{ env.REGISTRY }}
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Extract metadata (tags, labels) for Docker
38+
id: meta
39+
uses: docker/metadata-action@v5
40+
with:
41+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
42+
tags: |
43+
type=raw,value=latest,enable={{is_default_branch}}
44+
type=semver,pattern={{version}}
45+
type=sha,format=long
46+
type=ref,event=branch
47+
type=ref,event=tag
48+
49+
- name: Build and push Docker image
50+
uses: docker/build-push-action@v5
51+
with:
52+
context: .
53+
push: true
54+
platforms: linux/amd64,linux/arm64
55+
tags: ${{ steps.meta.outputs.tags }}
56+
labels: ${{ steps.meta.outputs.labels }}
57+
cache-from: type=gha
58+
cache-to: type=gha,mode=max

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ STAC Auth Proxy is a proxy API that mediates between the client and your interna
1818

1919
## Usage
2020

21-
> [!NOTE]
22-
> Currently, the project can only be installed by downloading the repository. It will eventually be available on Docker ([#5](https://github.com/developmentseed/stac-auth-proxy/issues/5)) and PyPi ([#30](https://github.com/developmentseed/stac-auth-proxy/issues/30)).
23-
2421
### Installation
2522

2623
For local development, we use [`uv`](https://docs.astral.sh/uv/) to manage project dependencies and environment.
@@ -35,15 +32,27 @@ Otherwise, the application can be installed as a standard Python module:
3532
pip install -e .
3633
```
3734

35+
> [!NOTE]
36+
> This project will be available on PyPi in the near future ([#30](https://github.com/developmentseed/stac-auth-proxy/issues/30)).
37+
3838
### Running
3939

40-
The simplest way to run the project is by calling the module directly:
40+
The simplest way to run the project is by invoking the application via Docker:
4141

4242
```sh
43-
python -m stac_auth_proxy
43+
docker run \
44+
-it --rm \
45+
-p 8000:8000 \
46+
-e UPSTREAM_URL=https://google.com \
47+
-e OIDC_DISCOVERY_URL=https://auth.openveda.cloud/realms/veda/.well-known/openid-configuration \
48+
ghcr.io/developmentseed/stac-auth-proxy:latest
4449
```
4550

46-
Alternatively, the application's factory can be passed to Uvicorn:
51+
Alternatively, the module can be invoked directly or the application's factory can be passed to Uvicorn:
52+
53+
```sh
54+
python -m stac_auth_proxy
55+
```
4756

4857
```sh
4958
uvicorn --factory stac_auth_proxy:create_app

0 commit comments

Comments
 (0)