Skip to content

Commit

Permalink
remove: action cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Sakurasan committed Nov 17, 2024
1 parent 017bcfc commit 4b60e17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 47 deletions.
25 changes: 3 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down
31 changes: 6 additions & 25 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Docker Image CI

name: Docker Image CI Tag
on:
push:
tags:
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 4b60e17

Please sign in to comment.