Skip to content

Migrate from CircleCI and Docker Hub to Github Actions and GHCR #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .circleci/config.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

on: push

name: build

jobs:
build:
name: Build Docker images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build directory-api image
run: |
cd api
docker build \
--no-cache \
--tag ghcr.io/spaceapi/directory-api \
--label "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
.
- name: Build directory-collector image
run: |
cd collector
docker build \
--no-cache \
--tag ghcr.io/spaceapi/directory-collector \
--label "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
.
48 changes: 48 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

on:
push:
branches:
- master
schedule:
- cron: "0 4 * * 1" # weekly

name: publish

jobs:
publish:
name: Publish Docker images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build directory-api image
run: |
cd api
docker build \
--no-cache \
--tag ghcr.io/spaceapi/directory-api \
--label "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
.
- name: Publish directory-api image
run: |
docker tag ghcr.io/spaceapi/directory-api ghcr.io/spaceapi/directory-api:$GITHUB_SHA
docker push ghcr.io/spaceapi/directory-api:$GITHUB_SHA
docker push ghcr.io/spaceapi/directory-api:latest
- name: Build directory-collector image
run: |
cd collector
docker build \
--no-cache \
--tag ghcr.io/spaceapi/directory-collector \
--label "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
.
- name: Publish directory-collector image
run: |
docker tag ghcr.io/spaceapi/directory-collector ghcr.io/spaceapi/directory-collector:$GITHUB_SHA
docker push ghcr.io/spaceapi/directory-collector:$GITHUB_SHA
docker push ghcr.io/spaceapi/directory-collector:latest