diff --git a/.github/workflows/publish_image.yaml b/.github/workflows/publish_image.yaml new file mode 100644 index 0000000..115eb42 --- /dev/null +++ b/.github/workflows/publish_image.yaml @@ -0,0 +1,41 @@ +name: Publish Docker Images + +on: + push: + branches: + - master + tags: + - v* + +jobs: + image: + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + attestations: write + steps: + - uses: earthly/actions-setup@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Check out the repo + uses: actions/checkout@v4 + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=semver,pattern={{raw}} + type=raw,value=latest,enable={{is_default_branch}} + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and Push Docker Image + run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} earthly --ci --push +docker --image_name="{}" diff --git a/Earthfile b/Earthfile index 5abf22d..998f71f 100644 --- a/Earthfile +++ b/Earthfile @@ -1,9 +1,9 @@ VERSION 0.6 -FROM alpine:3.14 +FROM alpine:3.19 WORKDIR /src build: - FROM rust:alpine3.14 + FROM rust:alpine3.19 RUN apk update \ && apk add \ git \ @@ -21,4 +21,5 @@ docker: WORKDIR /src ENTRYPOINT [ "tokei" ] CMD [ "--help" ] - SAVE IMAGE tokei + ARG image_name=tokei:latest + SAVE IMAGE --push $image_name diff --git a/README.md b/README.md index 49f5ece..83889ca 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ ![](https://img.shields.io/crates/d/tokei?label=downloads%20%28crates.io%29) ![](https://img.shields.io/github/downloads/xampprocky/tokei/total?label=downloads%20%28GH%29) ![](https://img.shields.io/homebrew/installs/dy/tokei?color=brightgreen&label=downloads%20%28brew%29) +[![dependency status](https://deps.rs/repo/github/XAMPPRocky/tokei/status.svg)](https://deps.rs/repo/github/XAMPPRocky/tokei) Tokei is a program that displays statistics about your code. Tokei will show the number of files, total lines within those files and code, comments, and blanks grouped by language.