Skip to content

Commit ff67b11

Browse files
committed
Build and publish docker images
1 parent a132c43 commit ff67b11

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build and Push Docker Images to GHCR
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-push-api:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Log in to the Container registry
19+
uses: docker/login-action@v3
20+
with:
21+
registry: ghcr.io
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Extract metadata (tags, labels) for API
26+
id: meta-api
27+
uses: docker/metadata-action@v5
28+
with:
29+
images: ghcr.io/developmentseed/stac-semantic-search/api
30+
tags: |
31+
type=sha
32+
type=raw,value=latest
33+
34+
- name: Build and push API image
35+
uses: docker/build-push-action@v5
36+
with:
37+
context: .
38+
file: ./Dockerfile
39+
push: true
40+
tags: ${{ steps.meta-api.outputs.tags }}
41+
labels: ${{ steps.meta-api.outputs.labels }}
42+
43+
build-and-push-streamlit:
44+
runs-on: ubuntu-latest
45+
permissions:
46+
contents: read
47+
packages: write
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v4
51+
52+
- name: Log in to the Container registry
53+
uses: docker/login-action@v3
54+
with:
55+
registry: ghcr.io
56+
username: ${{ github.actor }}
57+
password: ${{ secrets.GITHUB_TOKEN }}
58+
59+
- name: Extract metadata (tags, labels) for Streamlit
60+
id: meta-streamlit
61+
uses: docker/metadata-action@v5
62+
with:
63+
images: ghcr.io/developmentseed/stac-semantic-search/streamlit
64+
tags: |
65+
type=sha
66+
type=raw,value=latest
67+
68+
- name: Build and push Streamlit image
69+
uses: docker/build-push-action@v5
70+
with:
71+
context: ./frontend
72+
file: ./frontend/Dockerfile
73+
push: true
74+
tags: ${{ steps.meta-streamlit.outputs.tags }}
75+
labels: ${{ steps.meta-streamlit.outputs.labels }}

0 commit comments

Comments
 (0)