Skip to content

Changes docker workflow #2

Changes docker workflow

Changes docker workflow #2

name: Build and Push Docker Image to GHCR

Check failure on line 1 in .github/workflows/docker-publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/docker-publish.yml

Invalid workflow file

(Line: 9, Col: 15): Unrecognized function: 'toLower'. Located at position 1 within expression: toLower(github.repository)
on:
push:
tags: ["v*"]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ toLower(github.repository) }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Extract version from pyproject.toml
id: version
run: |
VERSION=$(grep -E '^version\s*=' pyproject.toml | awk -F'"' '{print $2}')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
labels: |
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
org.opencontainers.image.description=Creates date-based wordlists that can be used for penetration testing, QA fixtures, or any workflow that needs exhaustive date coverage.
org.opencontainers.image.version=${{ steps.version.outputs.version }}
org.opencontainers.image.source=${{ github.repositoryUrl }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=GNU Lesser General Public License v3.0