forked from commune-ai/subspace
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
100c76d
commit c3328d2
Showing
2 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
on: | ||
push: | ||
tags: ["*"] | ||
|
||
env: | ||
image_base: ghcr.io/agicommies/subspace | ||
|
||
jobs: | ||
tag-docker-image: | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
env: | ||
image_of_commit: $image_base:${{ steps.commit.outputs.short }} | ||
steps: | ||
- name: Docker Login | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checks if docker image is on registry | ||
run: | | ||
image_exists_check=$(docker manifest inspect "$image_of_commit" > /dev/null 2>&1; echo $?) | ||
if [ $image_exists_check -eq 0 ]; then | ||
echo "Image exists. Tagging with `${{ github.ref_name }}`" | ||
docker buildx imagetools create "$image_of_commit" --tag "$image_base:${{ github.ref_name }}" | ||
fi |