diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index c618547..d83afa6 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -1,48 +1,44 @@ -name: Create and publish a Docker image +name: Create and publish a Docker image to DockerHub on: release: - types: ['published'] + types: [published] env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} + DOCKER_NAMESPACE: marbleclimate + DOCKER_REPOSITORY: log-parser jobs: - build-and-push-image: + push_to_registry: + name: Push Docker image to Docker Hub runs-on: ubuntu-latest permissions: - contents: read packages: write + contents: read attestations: write id-token: write steps: - - name: Checkout repository + - name: Check out the repo uses: actions/checkout@v4 - - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.DOCKER_NAMESPACE }}/${{ env.DOCKER_REPOSITORY }} + - name: Build and push Docker image id: push - uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + uses: docker/build-push-action@v6 with: context: . push: true + provenance: mode=max tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - - - name: Generate artifact attestation - uses: actions/attest-build-provenance@v1 - with: - subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} - subject-digest: ${{ steps.push.outputs.digest }} - push-to-registry: true - diff --git a/README.md b/README.md index ae7ae9b..f267737 100644 --- a/README.md +++ b/README.md @@ -258,12 +258,12 @@ where the code for this extension is located. ## Docker -Docker images for this project can be found at https://github.com/DACCS-Climate/log-parser/pkgs/container/log-parser +Docker images for this project can be found at https://hub.docker.com/r/marbleclimate/log-parser To run the log parser with Docker: ```sh -docker run -it --rm ghcr.io/DACCS-Climate/log-parser:latest --help +docker run -it --rm marbleclimate/log-parser:latest --help ``` This is the equivalent of installing the Log Parser locally and running: @@ -276,7 +276,7 @@ The docker images also contain all extensions by default and they can be run by if you'd like to run the `prometheus` extension: ```sh -docker run -it --rm --entrypoint log-parser-prometheus ghcr.io/DACCS-Climate/log-parser:latest --help +docker run -it --rm --entrypoint marbleclimate/log-parser:latest --help ``` The entrypoint for all extensions is `log-parser-` where `` is the name of the extension. diff --git a/pyproject.toml b/pyproject.toml index 16257ca..0f6c28b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "log_parser" -version = "1.0.0" +version = "1.0.1" description = "A simple asynchronous log file parsing library" readme = "README.md" requires-python = ">=3.12"