Skip to content

test(uniregistrar): 🚨 remove comment #2

test(uniregistrar): 🚨 remove comment

test(uniregistrar): 🚨 remove comment #2

name: Publish Docker image
on:
push:
branches: ['main']
jobs:
file-changes:
name: "πŸ—ƒοΈ Check file changes"
runs-on: ubuntu-latest
outputs:
registrar: ${{ steps.filter.outputs.registrar }}
steps:
- name: πŸ›ŽοΈ Checkout
uses: actions/checkout@v4
- name: πŸ“‚ paths filter
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
registrar:
- 'universal-registrar/**'
set-version:
name: "πŸ“Œ Set version"
runs-on: ubuntu-latest
needs: [file-changes]
if: "needs.file-changes.outputs.registrar == 'true'"
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: ⬇ install dependecy
run: sudo apt-get install -y skopeo jq
- name: πŸ“‘ get docker version
id: version
run: |
(skopeo inspect docker://docker.io/dyne/did-registrar:0.1 2>/dev/null || echo '{"RepoTags": ["0.0"]}') \
| jq -r '.RepoTags | .[]' \
| sort -Vr \
| head -n 1 \
| awk 'BEGIN{FS=OFS="."} {$2+=1} { printf("version=%s.%s\n",$1, $2) }' >> $GITHUB_OUTPUT
push_to_registry:
name: πŸ‹ Push Docker image to Docker Hub
runs-on: ubuntu-latest
needs: [set-version]
steps:
- name: πŸ›ŽοΈ Checkout
uses: actions/checkout@v4
- name: πŸ” Log in to Docker Hub
uses: docker/login-action@v3
with:
username: dyne
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: ⛏️ Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
dyne/did-registrar
labels: |
org.opencontainers.image.vendor=Dyne.org
- name: πŸ—οΈ Build and push Docker image
uses: docker/build-push-action@v5
with:
context: universal-registrar
push: true
tags: ${{ needs.set-version.outputs.version }}
labels: ${{ steps.meta.outputs.labels }}