Skip to content

Commit 39ded02

Browse files
authored
Migrate from CircleCI and Docker Hub to Github Actions and GHCR (#16)
1 parent 3fb24ef commit 39ded02

File tree

3 files changed

+75
-41
lines changed

3 files changed

+75
-41
lines changed

.circleci/config.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
on: push
3+
4+
name: build
5+
6+
jobs:
7+
build:
8+
name: Build Docker images
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Build directory-api image
13+
run: |
14+
cd api
15+
docker build \
16+
--no-cache \
17+
--tag ghcr.io/spaceapi/directory-api \
18+
--label "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
19+
.
20+
- name: Build directory-collector image
21+
run: |
22+
cd collector
23+
docker build \
24+
--no-cache \
25+
--tag ghcr.io/spaceapi/directory-collector \
26+
--label "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
27+
.

.github/workflows/publish.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
on:
3+
push:
4+
branches:
5+
- master
6+
schedule:
7+
- cron: "0 4 * * 1" # weekly
8+
9+
name: publish
10+
11+
jobs:
12+
publish:
13+
name: Publish Docker images
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Login to GitHub Container Registry
18+
uses: docker/login-action@v3
19+
with:
20+
registry: ghcr.io
21+
username: ${{ github.actor }}
22+
password: ${{ secrets.GITHUB_TOKEN }}
23+
- name: Build directory-api image
24+
run: |
25+
cd api
26+
docker build \
27+
--no-cache \
28+
--tag ghcr.io/spaceapi/directory-api \
29+
--label "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
30+
.
31+
- name: Publish directory-api image
32+
run: |
33+
docker tag ghcr.io/spaceapi/directory-api ghcr.io/spaceapi/directory-api:$GITHUB_SHA
34+
docker push ghcr.io/spaceapi/directory-api:$GITHUB_SHA
35+
docker push ghcr.io/spaceapi/directory-api:latest
36+
- name: Build directory-collector image
37+
run: |
38+
cd collector
39+
docker build \
40+
--no-cache \
41+
--tag ghcr.io/spaceapi/directory-collector \
42+
--label "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
43+
.
44+
- name: Publish directory-collector image
45+
run: |
46+
docker tag ghcr.io/spaceapi/directory-collector ghcr.io/spaceapi/directory-collector:$GITHUB_SHA
47+
docker push ghcr.io/spaceapi/directory-collector:$GITHUB_SHA
48+
docker push ghcr.io/spaceapi/directory-collector:latest

0 commit comments

Comments
 (0)