diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index e8c28e1..62ab4b1 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -9,7 +9,6 @@ concurrency: env: IMAGE_NAME: commune - GHCR_REGISTRY: ghcr.io/commune-os jobs: publish_image: @@ -53,3 +52,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 diff --git a/Justfile b/Justfile index 5769572..8862dd0 100644 --- a/Justfile +++ b/Justfile @@ -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}}