Created
March 18, 2026 04:40
-
-
Save kurtpayne/dc804cdeb5dcfeee202c075384201d83 to your computer and use it in GitHub Desktop.
skillscan-lint: Docker Hub release workflow — paste into .github/workflows/release-docker.yml
This file contains hidden or 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: Release Docker | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| jobs: | |
| docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate tag matches project version | |
| run: | | |
| PROJECT_VERSION=$(python3 - <<'PY' | |
| import tomllib | |
| from pathlib import Path | |
| data = tomllib.loads(Path('pyproject.toml').read_text()) | |
| print(data['project']['version']) | |
| PY | |
| ) | |
| TAG_VERSION="${GITHUB_REF_NAME#v}" | |
| if [ "$PROJECT_VERSION" != "$TAG_VERSION" ]; then | |
| echo "Tag/version mismatch: tag=$TAG_VERSION pyproject=$PROJECT_VERSION" | |
| exit 1 | |
| fi | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ secrets.DOCKERHUB_USERNAME }}/skillscan-lint | |
| tags: | | |
| type=ref,event=tag | |
| type=raw,value=latest | |
| - name: Build and push multi-arch image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Update Docker Hub description | |
| uses: peter-evans/dockerhub-description@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| repository: ${{ secrets.DOCKERHUB_USERNAME }}/skillscan-lint | |
| readme-filepath: ./DOCKER_HUB_DESCRIPTION.md |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment