Skip to content

Commit

Permalink
Fix naming convention to support Docker build and push
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Sep 18, 2024
1 parent c135191 commit 3c7a3de
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/docker-description.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:

env:
DOCKER_REGISTRY: "https://hub.docker.com/v2"
DOCKER_REPOSITORY: "${{ github.event.repository.name }}"
DESCRIPTION_LIMIT: 100

jobs:
Expand All @@ -19,6 +18,12 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set Repository
run: |
docker_repository=$(echo "${{ github.event.repository.name }}" | tr '[:upper:]' '[:lower:]')
echo "DOCKER_REPOSITORY=${{ secrets.DOCKER_USERNAME }}/${docker_repository}" >> $GITHUB_ENV
shell: bash

- name: Fetch API Token
run: |
payload=$(jq -n \
Expand Down Expand Up @@ -62,7 +67,7 @@ jobs:
'{description: $description, full_description: $full_description}')
response=$(curl -s -o /tmp/desc -w "%{http_code}" -X PATCH \
"${{ env.DOCKER_REGISTRY }}/repositories/${{ secrets.DOCKER_USERNAME }}/${{ env.DOCKER_REPOSITORY }}/" \
"${{ env.DOCKER_REGISTRY }}/repositories/${{ env.DOCKER_REPOSITORY }}/" \
-H "Authorization: Bearer ${{ env.API_TOKEN }}" \
-H "Content-Type: application/json" \
-d "$payload")
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build and Publish
name: Build and Publish (Docker)

on:
release:
Expand All @@ -12,6 +12,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Repository
run: |
docker_repository=$(echo "${{ github.event.repository.name }}" | tr '[:upper:]' '[:lower:]')
echo "DOCKER_REPOSITORY=${{ secrets.DOCKER_USERNAME }}/${docker_repository}" >> $GITHUB_ENV
shell: bash
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand All @@ -27,4 +32,5 @@ jobs:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ github.repository }}:${{ github.event.release.tag_name }},${{ github.repository }}:latest
tags: |
${{ env.DOCKER_REPOSITORY }}:${{ github.event.release.tag_name }},${{ env.DOCKER_REPOSITORY }}:latest
2 changes: 1 addition & 1 deletion .github/workflows/markdown.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: none-shall-pass
name: None Shall Pass

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pypi-publish
name: Build and Publish (PyPi)

on:
release:
Expand Down

0 comments on commit 3c7a3de

Please sign in to comment.