Docker build update #10 (I hope final)

This commit is contained in:
LukeGus
2024-12-07 02:06:19 -06:00
parent ebf00630fd
commit d422a9ad25
2 changed files with 16 additions and 39 deletions

View File

@@ -23,14 +23,6 @@ jobs:
with: with:
node-version: '18' node-version: '18'
- name: Cache Node Modules
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install Dependencies and Build Frontend - name: Install Dependencies and Build Frontend
run: | run: |
cd frontend cd frontend
@@ -60,30 +52,7 @@ jobs:
fi fi
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Cache ghcr-cleaner - name: Build and Push Docker Image
uses: actions/cache@v3
with:
path: /usr/local/bin/ghcr-cleaner
key: ghcr-cleaner-${{ runner.os }}-${{ hashFiles('path/to/ghcr-cleaner-version-file') }}
restore-keys: |
ghcr-cleaner-${{ runner.os }}-
- name: Download ghcr-cleaner if not cached
run: |
if ! command -v ghcr-cleaner &> /dev/null; then
echo "ghcr-cleaner not found, downloading..."
curl -L https://github.com/quartz-analytics/ghcr-cleaner/releases/download/v1.0.0/ghcr-cleaner-linux-amd64 -o /usr/local/bin/ghcr-cleaner
chmod +x /usr/local/bin/ghcr-cleaner
else
echo "ghcr-cleaner found, skipping download"
fi
- name: Prune BuildKit Cache
run: |
echo "Pruning BuildKit cache..."
docker builder prune -f
- name: Build and Push Docker Image with Cache
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
@@ -91,8 +60,8 @@ jobs:
push: true push: true
tags: ghcr.io/${{ env.REPO_OWNER }}/ssh-project:${{ env.IMAGE_TAG }} tags: ghcr.io/${{ env.REPO_OWNER }}/ssh-project:${{ env.IMAGE_TAG }}
labels: org.opencontainers.image.source=https://github.com/${{ github.repository }} labels: org.opencontainers.image.source=https://github.com/${{ github.repository }}
cache-from: type=gha,ref=ghcr.io/${{ env.REPO_OWNER }}/ssh-project:cache cache-from: type=gha
cache-to: type=gha,mode=max,ref=ghcr.io/${{ env.REPO_OWNER }}/ssh-project:cache cache-to: type=gha,mode=max
- name: Notify via ntfy - name: Notify via ntfy
run: | run: |
@@ -106,7 +75,6 @@ jobs:
token: ${{ secrets.GHCR_TOKEN }} token: ${{ secrets.GHCR_TOKEN }}
repository-owner: ${{ github.repository_owner }} repository-owner: ${{ github.repository_owner }}
delete-untagged: true delete-untagged: true
keep-at-most: 0
- name: Cleanup Docker Images Locally - name: Cleanup Docker Images Locally
run: | run: |

17
.idea/workspace.xml generated
View File

@@ -4,7 +4,7 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="8497df64-d86b-4c98-ac58-c157d9d3fb1e" name="Changes" comment="Docker build update #9 (nevermind not finanl)"> <list default="true" id="8497df64-d86b-4c98-ac58-c157d9d3fb1e" name="Changes" comment="Docker build update #10">
<change beforePath="$PROJECT_DIR$/.github/workflows/docker-image.yml" beforeDir="false" afterPath="$PROJECT_DIR$/.github/workflows/docker-image.yml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.github/workflows/docker-image.yml" beforeDir="false" afterPath="$PROJECT_DIR$/.github/workflows/docker-image.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
</list> </list>
@@ -115,7 +115,7 @@
<updated>1733439468142</updated> <updated>1733439468142</updated>
<workItem from="1733439479708" duration="5489000" /> <workItem from="1733439479708" duration="5489000" />
<workItem from="1733448523969" duration="3535000" /> <workItem from="1733448523969" duration="3535000" />
<workItem from="1733549186397" duration="8033000" /> <workItem from="1733549186397" duration="8448000" />
</task> </task>
<task id="LOCAL-00001" summary="Nano zoom fix #11"> <task id="LOCAL-00001" summary="Nano zoom fix #11">
<option name="closed" value="true" /> <option name="closed" value="true" />
@@ -301,7 +301,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1733558138278</updated> <updated>1733558138278</updated>
</task> </task>
<option name="localTasksCounter" value="24" /> <task id="LOCAL-00024" summary="Docker build update #10">
<option name="closed" value="true" />
<created>1733558347319</created>
<option name="number" value="00024" />
<option name="presentableId" value="LOCAL-00024" />
<option name="project" value="LOCAL" />
<updated>1733558347319</updated>
</task>
<option name="localTasksCounter" value="25" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@@ -349,6 +357,7 @@
<MESSAGE value="Docker build update #7 (final)" /> <MESSAGE value="Docker build update #7 (final)" />
<MESSAGE value="Docker build update #8 (nevermind not finanl)" /> <MESSAGE value="Docker build update #8 (nevermind not finanl)" />
<MESSAGE value="Docker build update #9 (nevermind not finanl)" /> <MESSAGE value="Docker build update #9 (nevermind not finanl)" />
<option name="LAST_COMMIT_MESSAGE" value="Docker build update #9 (nevermind not finanl)" /> <MESSAGE value="Docker build update #10" />
<option name="LAST_COMMIT_MESSAGE" value="Docker build update #10" />
</component> </component>
</project> </project>