test(uniregistrar): π¨ remove comment #2
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
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 }} |