mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 21:30:51 +00:00
CI: build and publish exposed docker package
This commit is contained in:
parent
52ea8a9f45
commit
75e24e000b
2 changed files with 60 additions and 2 deletions
58
.github/workflows/docker.yml
vendored
Normal file
58
.github/workflows/docker.yml
vendored
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
name: "Publish Docker Image"
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-docker-image:
|
||||||
|
name: "Build Docker Image"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
- name: Magic Nix Cache
|
||||||
|
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||||
|
|
||||||
|
- name: Build Docker Image
|
||||||
|
run: nix build .#docker-nix --print-build-logs
|
||||||
|
|
||||||
|
- name: Load & Tag Built Docker Image
|
||||||
|
run: |
|
||||||
|
docker load -i result &&
|
||||||
|
docker tag neovim-flake:latest notashelf/neovim-flake:latest
|
||||||
|
|
||||||
|
- name: Log into DockerHub
|
||||||
|
uses: docker/login-action@master
|
||||||
|
with:
|
||||||
|
username: notashelf
|
||||||
|
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||||
|
|
||||||
|
- name: Push to DockerHub
|
||||||
|
run: docker push notashelf/neovim-flake:latest
|
||||||
|
|
||||||
|
- name: Log into ghcr
|
||||||
|
uses: docker/login-action@master
|
||||||
|
with:
|
||||||
|
registry: "ghcr.io"
|
||||||
|
username: "${{ github.actor }}"
|
||||||
|
password: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
|
||||||
|
- name: Publish Docker Image (Github Packages)
|
||||||
|
run: docker push notashelf/neovim-flake:latest
|
|
@ -30,13 +30,13 @@
|
||||||
maximal = config.legacyPackages.neovim-maximal;
|
maximal = config.legacyPackages.neovim-maximal;
|
||||||
default = config.legacyPackages.neovim-nix;
|
default = config.legacyPackages.neovim-nix;
|
||||||
|
|
||||||
# Publisged docker images
|
# Published docker images
|
||||||
docker-nix = let
|
docker-nix = let
|
||||||
inherit (pkgs) bash gitFull buildEnv dockerTools;
|
inherit (pkgs) bash gitFull buildEnv dockerTools;
|
||||||
inherit (config.legacyPackages) neovim-nix;
|
inherit (config.legacyPackages) neovim-nix;
|
||||||
in
|
in
|
||||||
dockerTools.buildImage {
|
dockerTools.buildImage {
|
||||||
name = "neovim-flake-nix";
|
name = "neovim-flake";
|
||||||
tag = "latest";
|
tag = "latest";
|
||||||
|
|
||||||
copyToRoot = buildEnv {
|
copyToRoot = buildEnv {
|
||||||
|
|
Loading…
Reference in a new issue