build: clean and add labels
This commit is contained in:
@@ -32,25 +32,20 @@ jobs:
|
|||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
- name: Ensure repository exists
|
|
||||||
run: |
|
|
||||||
curl -f -X POST \
|
|
||||||
-H "Authorization: token ${{ secrets.REGISTRY_PASSWORD }}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d '{"name":"zebra-power","private":false,"description":"Zebra Power Docker Images"}' \
|
|
||||||
${{ env.REGISTRY }}/api/v1/user/repos || echo "Repository may already exist"
|
|
||||||
|
|
||||||
- name: Extract metadata
|
- name: Extract metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ secrets.REGISTRY_USERNAME }}/${{ env.NAMESPACE }}/zebra-${{ matrix.service }}
|
images: ${{ env.REGISTRY }}/${{ secrets.REGISTRY_USERNAME }}/${{ env.NAMESPACE }}/${{ matrix.service }}
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=raw,value=latest,enable={{is_default_branch}}
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
type=sha,prefix={{branch}}-,suffix=-{{date 'YYYYMMDD-HHmmss'}},enable={{is_default_branch}}
|
type=sha,prefix={{branch}}-,suffix=-{{date 'YYYYMMDD-HHmmss'}},enable={{is_default_branch}}
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.source={{.Repository}}
|
||||||
|
org.opencontainers.image.revision={{.SHA}}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
id: build
|
id: build
|
||||||
|
|||||||
Reference in New Issue
Block a user