Deploy Images to GHCR #6
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
name: Deploy Images to GHCR | |
on: | |
push: | |
tags: | |
- v* | |
workflow_dispatch: | |
permissions: | |
packages: write | |
jobs: | |
push-container-image: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: true | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: true | |
docker-images: true | |
swap-storage: true | |
- uses: actions/checkout@main | |
- name: Install Nix | |
uses: cachix/install-nix-action@v22 | |
with: | |
github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build container image | |
run: nix build .#sdxlContainer | |
- name: 'Login to GitHub Container Registry' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: 'Push Container Image' | |
run: | | |
nix store gc | |
docker load < result | |
docker tag leco-sdxl:0.1.0 ghcr.io/capslock/leco-sdxl:latest | |
docker push ghcr.io/capslock/leco-sdxl:latest |