Optimize docker build
This commit is contained in:
@@ -23,10 +23,10 @@ jobs:
|
||||
|
||||
- name: Get version
|
||||
id: get_version
|
||||
run: echo "::set-output name=version::$(cat VERSION)"
|
||||
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
@@ -35,26 +35,22 @@ jobs:
|
||||
username: ninluc
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Cache Docker layers (registry-backed)
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: buildx-cache-${{ github.sha }}
|
||||
restore-keys: |
|
||||
buildx-cache-
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
push: true
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
build-args: |
|
||||
VITE_REVERB_APP_KEY=${{ secrets.REVERB_APP_KEY }}
|
||||
VITE_REVERB_HOST=perceptron.matthiasg.dev
|
||||
VITE_REVERB_PORT=443
|
||||
VITE_REVERB_SCHEME=https
|
||||
tags: git.matthiasg.dev/ninluc/perceptron-viewer/perceptron-viewer:latest, git.matthiasg.dev/ninluc/perceptron-viewer/perceptron-viewer:${{ steps.get_version.outputs.version }}
|
||||
tags: |
|
||||
git.matthiasg.dev/ninluc/perceptron-viewer/perceptron-viewer:latest
|
||||
git.matthiasg.dev/ninluc/perceptron-viewer/perceptron-viewer:${{ steps.get_version.outputs.version }}
|
||||
|
||||
# notify:
|
||||
# needs: build
|
||||
|
||||
Reference in New Issue
Block a user