Skip to content

Commit

Permalink
Moved container to ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Kosmaczewski committed Mar 28, 2023
1 parent 67fbcdf commit 0bf7f03
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 57 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Create and publish a container image

on:
push:
branches: [ master ]
tags: [ '*' ]
pull_request:
branches: [ master ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
uses: docker/login-action@219c305e1ce92a755f3aa4ba17387c95df31e987
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
40 changes: 0 additions & 40 deletions .github/workflows/docker-image.yml

This file was deleted.

17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
############################
# STEP 1
############################
FROM golang:alpine AS builder
FROM docker.io/library/golang:alpine AS builder

# Install build tools
RUN apk update && apk add --no-cache wget zip tar
WORKDIR /

RUN wget https://github.com/errata-ai/vale/releases/download/v2.15.4/vale_2.15.4_Linux_64-bit.tar.gz && \
tar -xvzf vale_2.15.4_Linux_64-bit.tar.gz
RUN wget -q https://github.com/errata-ai/vale/releases/download/v2.15.4/vale_2.15.4_Linux_64-bit.tar.gz && \
tar -xzf vale_2.15.4_Linux_64-bit.tar.gz

# Install Microsoft style file
RUN wget https://github.com/errata-ai/Microsoft/releases/download/v0.9.0/Microsoft.zip && \
unzip Microsoft.zip
RUN wget -q https://github.com/errata-ai/Microsoft/releases/download/v0.9.0/Microsoft.zip && \
unzip -qq Microsoft.zip

# Install Openly style file
RUN wget https://github.com/testthedocs/Openly/releases/download/0.3.1/Openly.zip && \
unzip Openly.zip
RUN wget -q https://github.com/testthedocs/Openly/releases/download/0.3.1/Openly.zip && \
unzip -qq Openly.zip

############################
# STEP 2
############################
FROM alpine:3.17.2
FROM docker.io/library/alpine:3.17.2

RUN apk add --update \
python3 \
Expand All @@ -40,4 +40,3 @@ COPY vale.ini /.vale.ini
COPY Vocab /styles/Vocab

ENTRYPOINT ["/usr/local/bin/vale"]

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
all: build

build:
docker build -t vshn/vale .
podman build -t vshn/vale .

13 changes: 6 additions & 7 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
= Vale for VSHN

This project generates a ready-to-use installation of the https://github.com/errata-ai/vale[vale tool], a "syntax-aware linter for prose built with speed and extensibility in mind."
This project generates a ready-to-use installation of the https://github.com/errata-ai/vale[vale], a "syntax-aware linter for prose built with speed and extensibility in mind."

This image is geared specifically to verify Asciidoc files using the Microsoft, Openly and built-in Vale text style rules. It contains:

* `vale`
* https://github.com/errata-ai/vale[vale]
* https://github.com/errata-ai/Microsoft[Microsoft style rules]
* https://github.com/testthedocs/Openly[Openly style rules]
* https://asciidoctor.org/[Asciidoctor]
Expand All @@ -13,8 +13,7 @@ This image is geared specifically to verify Asciidoc files using the Microsoft,

Use it as follows, for example on an Antora project root, to verify all Asciidoc files in that folder:

`docker run --rm -t -v $(pwd)/modules/ROOT/pages:/pages vshn/vale /pages`

You can also specify an individual file instead of a whole folder:

`docker run --rm -t -v $(pwd)/modules/ROOT/pages:/pages vshn/vale /pages/file.adoc`
[source,bash]
--
podman run --rm --volume "${PWD}"/src/modules/ROOT/pages:/pages --workdir /pages ghcr.io/vshn/vale:2.15.5 --minAlertLevel=error .
--

0 comments on commit 0bf7f03

Please sign in to comment.