Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Action to publish docker images #1096

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/publish_image.yaml
Original file line number Diff line number Diff line change
@@ -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="{}"
7 changes: 4 additions & 3 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -21,4 +21,5 @@ docker:
WORKDIR /src
ENTRYPOINT [ "tokei" ]
CMD [ "--help" ]
SAVE IMAGE tokei
ARG image_name=tokei:latest
SAVE IMAGE --push $image_name
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Loading