Changes docker workflow #2
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: Build and Push Docker Image to GHCR | ||
| 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 | ||