remove: action cache

This commit is contained in:
Sakurasan
2024-11-17 22:13:29 +08:00
parent 017bcfcb32
commit 4b60e17fec
2 changed files with 9 additions and 47 deletions

View File

@@ -13,7 +13,6 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Get current date
id: date
run: echo "today=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
@@ -24,23 +23,13 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
@@ -52,14 +41,6 @@ jobs:
tags: |
${{ github.repository }}:${{ steps.date.outputs.today }}
${{ github.repository }}:${{ contains(github.ref,'main') && 'latest' || github.ref_name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:

View File

@@ -1,5 +1,4 @@
name: Docker Image CI
name: Docker Image CI Tag
on:
push:
tags:
@@ -12,8 +11,8 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Get version
- name: Get version
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
@@ -23,23 +22,13 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
@@ -51,14 +40,6 @@ jobs:
tags: |
${{ github.repository }}:${{ steps.vars.outputs.tag }}
${{ github.repository }}:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with: