-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: build and publish exposed docker package
- Loading branch information
Showing
2 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: "Publish Docker Image" | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "v*" # only publish tagged releases | ||
|
||
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 Exposed Docker Image | ||
run: nix build .#docker-nix --print-build-logs | ||
|
||
- name: Load & Tag Built Docker Image | ||
run: | | ||
docker load -i result ; docker images | ||
docker tag localhost/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 ghcr.io/neovim-flake:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters