Skip to content
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

chore(cd): publish image to ghcr #20

Merged
merged 2 commits into from
Feb 5, 2024
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
13 changes: 12 additions & 1 deletion .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ name: Publish Docker Image

on:
push:
branches:
- main

concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true

env:
IMAGE_NAME: commune
GHCR_REGISTRY: ghcr.io/commune-os

jobs:
publish_image:
Expand Down Expand Up @@ -53,3 +54,13 @@ jobs:

- name: Build Image
run: just docker_build_image

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Publish image to GitHub Container Registry
run: just docker_publish_image
5 changes: 5 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,8 @@ docker_build_image: docker_build_server
cp ./target/{{target_release}}/release/server ./tmp/server
chmod +x ./tmp/server
docker build -t "commune:{{commit_sha}}-{{target_release}}" .

# Publishes the Docker image to the GitHub Container Registry
docker_publish_image:
docker tag commune:{{commit_sha}}-{{target_release}} ghcr.io/commune-os/commune:{{commit_sha}}-{{target_release}}
docker push ghcr.io/commune-os/commune:{{commit_sha}}-{{target_release}}
Loading