Skip to content

Commit d26c5ef

Browse files
committed
ci: only build packages on main or tags
1 parent 83679f9 commit d26c5ef

File tree

2 files changed

+46
-38
lines changed

2 files changed

+46
-38
lines changed

.github/workflows/cicd.yaml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -186,41 +186,3 @@ jobs:
186186
- uses: actions/checkout@v3
187187
- name: Test generating docs
188188
run: make docs
189-
190-
docker-build-push:
191-
runs-on: ubuntu-latest
192-
needs: [test, validate, test-docs]
193-
permissions:
194-
contents: read
195-
packages: write
196-
strategy:
197-
fail-fast: true
198-
matrix:
199-
backend: ["sqlalchemy", "pgstac"]
200-
steps:
201-
- name: Checkout repository
202-
uses: actions/checkout@v3
203-
- name: Log in to the Container registry
204-
uses: docker/[email protected]
205-
with:
206-
registry: ghcr.io
207-
username: ${{ github.actor }}
208-
password: ${{ secrets.GITHUB_TOKEN }}
209-
- name: Extract metadata (tags, labels) for Docker
210-
id: meta
211-
uses: docker/[email protected]
212-
with:
213-
images: ghcr.io/stac-utils/stac-fastapi
214-
tags: |
215-
type=schedule,suffix=-${{ matrix.backend }}
216-
type=ref,event=branch,suffix=-${{ matrix.backend }}
217-
type=ref,event=tag,suffix=-${{ matrix.backend }}
218-
type=ref,event=pr,suffix=-${{ matrix.backend }}
219-
- name: Build and push Docker image
220-
uses: docker/[email protected]
221-
with:
222-
context: .
223-
file: docker/Dockerfile.${{ matrix.backend }}
224-
push: true
225-
tags: ${{ steps.meta.outputs.tags }}
226-
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/packages.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: packages
2+
on:
3+
push:
4+
branches:
5+
- master
6+
tags:
7+
- "*"
8+
9+
jobs:
10+
docker-build-push:
11+
runs-on: ubuntu-latest
12+
needs: [test, validate, test-docs]
13+
permissions:
14+
contents: read
15+
packages: write
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
backend: ["sqlalchemy", "pgstac"]
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
- name: Log in to the Container registry
24+
uses: docker/[email protected]
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
- name: Extract metadata (tags, labels) for Docker
30+
id: meta
31+
uses: docker/[email protected]
32+
with:
33+
images: ghcr.io/stac-utils/stac-fastapi
34+
tags: |
35+
type=schedule,suffix=-${{ matrix.backend }}
36+
type=ref,event=branch,suffix=-${{ matrix.backend }}
37+
type=ref,event=tag,suffix=-${{ matrix.backend }}
38+
type=ref,event=pr,suffix=-${{ matrix.backend }}
39+
- name: Build and push Docker image
40+
uses: docker/[email protected]
41+
with:
42+
context: .
43+
file: docker/Dockerfile.${{ matrix.backend }}
44+
push: true
45+
tags: ${{ steps.meta.outputs.tags }}
46+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)