Compile Docker Image #45
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: Compile Docker Image | |
on: | |
- workflow_dispatch | |
jobs: | |
compile-docker: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
env: | |
RUN_INTEGRATION_TEST: 0 | |
RUN_UNIT_TEST: 0 | |
RUN_TYPE_CHECK: 0 | |
RUN_IMPORT_CHECK: 0 | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Clean and Prune System | |
run: | | |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL | |
sudo docker system prune --all --force | |
- name: Build source distribution | |
run: | | |
pip install pibble | |
make dockerfile | |
- name: Get Version | |
id: version | |
run: echo "version=$(make version)" >> $GITHUB_OUTPUT | |
- name: Get current datetime | |
id: datetime | |
run: echo "datetime=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT | |
- name: Log in to the Container registry | |
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker Image | |
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | |
with: | |
context: build/ | |
file: build/dockerfile-cuda | |
push: true | |
tags: | | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }} | |
labels: | | |
org.opencontainers.image.title=Enfugue | |
org.opencontainers.image.description=The Enfugue Stable Diffusion Webapp | |
org.opencontainers.image.licenses=AGPL3 | |
org.opencontainers.image.version=${{ steps.version.outputs.version }} | |
org.opencontainers.image.created=${{ steps.datetime.outputs.datetime }} |