Skip to content

push container image #11

push container image

push container image #11

Workflow file for this run

name: push container image
on:
workflow_dispatch:
inputs:
image_name:
type: string
required: true
description: "The name of the container image to build"
jobs:
publish-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install nix
uses: DeterminateSystems/nix-installer-action@v2
with:
logger: pretty
log-directives: nix_installer=trace
backtrace: full
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: build image
run: nix build .#image/${{ inputs.image_name }}
- name: login to registry
env:
USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
PASSWORD: ${{ secrets.DOCKER_HUB_TOKEN }}
run: echo $PASSWORD | nix develop .#ci -c skopeo login docker.io -u $USERNAME --password-stdin
- name: push to docker
env:
VERSION: ${{ github.sha }}
run: nix develop .#ci -c skopeo copy docker-archive:result docker://justinrubek/${{ inputs.image_name }}:$VERSION --insecure-policy