Files
eleith 66d9f94216
ci/woodpecker/pr/build-dane-verify Pipeline was successful
ci/woodpecker/pr/build-porkbun-ddns Pipeline was successful
ci/woodpecker/push/build-dane-verify Pipeline was successful
ci/woodpecker/push/build-hledger Pipeline was successful
ci/woodpecker/push/build-nvim Pipeline was successful
ci/woodpecker/push/build-playwright Pipeline was successful
ci/woodpecker/push/build-porkbun-ddns Pipeline was successful
Align CI tags, PR checks, and docs
2026-10-24 08:56:01 -07:00

67 lines
2.4 KiB
YAML

name: Build and Push nvim
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "nvim/**"
- ".github/workflows/build-nvim.yml"
tags:
- "nvim/v*"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Extract tag name
id: tag_name
run: |
if [[ "${{ github.ref_type }}" == "tag" ]]; then
TAG="${{ github.ref_name }}"
VERSION="${TAG#nvim/v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
fi
NVIM_VERSION=$(sed -n 's|^ARG NVIM_VERSION=\([0-9.]*\).*|\1|p' nvim/Dockerfile)
LUALS_VERSION=$(sed -n 's|^ARG LUALS_VERSION=\([0-9.]*\).*|\1|p' nvim/Dockerfile)
STYLUA_VERSION=$(sed -n 's|^ARG STYLUA_VERSION=\([0-9.]*\).*|\1|p' nvim/Dockerfile)
echo "variant=$NVIM_VERSION-luals$LUALS_VERSION-stylua$STYLUA_VERSION" >> $GITHUB_OUTPUT
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/containers-nvim
flavor: latest=false
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=raw,value=${{ steps.tag_name.outputs.variant }},enable=${{ github.ref_type == 'tag' }}
type=semver,pattern={{version}},value=${{ steps.tag_name.outputs.version }},enable=${{ github.ref_type == 'tag' }}
type=semver,pattern={{major}}.{{minor}},value=${{ steps.tag_name.outputs.version }},enable=${{ github.ref_type == 'tag' }}
type=semver,pattern={{major}},value=${{ steps.tag_name.outputs.version }},enable=${{ github.ref_type == 'tag' }}
- name: Login to GitHub Container Registry
if: github.ref == 'refs/heads/main' || github.ref_type == 'tag'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ./nvim
file: ./nvim/Dockerfile
push: ${{ github.ref == 'refs/heads/main' || github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}