Skip to content

Commit 135dbe2

Browse files
committed
fix: Remove caching from GitHub actions to allow compilation of docker container
The GitHub action `actions/cache@v2` is no longer available. Last successful docker build was 2024-11-15 I've removed the caching, as merely upgrading the version of the cache script did not fix the problem. Since the revoltchat/revite is deprecated I believe that the lack of caching in builds shouldn't be an undue burden on GitHub. Only 9 commits have been made here since builds stopped working The logic for publishing Docker containers has been shuffled so that the build is executed only once when publishing. I have tested building to GitHub's container registry, but not to dockerhub, I do not forsee any issues there. Main reason for doing this, is that a fix for attachment downloads (#1067) is not easily available to anyone running self-hosted.
1 parent f95d3d2 commit 135dbe2

File tree

1 file changed

+8
-49
lines changed

1 file changed

+8
-49
lines changed

.github/workflows/docker.yml

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -30,82 +30,41 @@ on:
3030
workflow_dispatch:
3131

3232
jobs:
33-
test:
34-
runs-on: ubuntu-latest
35-
strategy:
36-
matrix:
37-
architecture: [linux/amd64]
38-
steps:
39-
- name: Checkout
40-
uses: actions/checkout@v2
41-
with:
42-
submodules: "recursive"
43-
- name: Set up QEMU
44-
uses: docker/setup-qemu-action@v1
45-
- name: Set up Docker Buildx
46-
uses: docker/setup-buildx-action@v1
47-
- name: Cache Docker layers
48-
uses: actions/cache@v2
49-
with:
50-
path: /tmp/.buildx-cache/${{ matrix.architecture }}
51-
key: ${{ runner.os }}-buildx-${{ matrix.architecture }}-${{ github.sha }}
52-
- name: Build
53-
uses: docker/build-push-action@v2
54-
with:
55-
context: .
56-
platforms: ${{ matrix.architecture }}
57-
cache-from: type=local,src=/tmp/.buildx-cache/${{ matrix.architecture }}
58-
cache-to: type=local,dest=/tmp/.buildx-cache-new/${{ matrix.architecture }},mode=max
59-
- name: Move cache
60-
run: |
61-
rm -rf /tmp/.buildx-cache/${{ matrix.architecture }}
62-
mv /tmp/.buildx-cache-new/${{ matrix.architecture }} /tmp/.buildx-cache/${{ matrix.architecture }}
63-
6433
publish:
65-
needs: [test]
6634
runs-on: ubuntu-latest
6735
if: github.event_name != 'pull_request'
6836
steps:
6937
- name: Checkout
70-
uses: actions/checkout@v2
38+
uses: actions/checkout@v4
7139
with:
7240
submodules: "recursive"
7341
- name: Set up QEMU
74-
uses: docker/setup-qemu-action@v1
42+
uses: docker/setup-qemu-action@v3
7543
- name: Set up Docker Buildx
76-
uses: docker/setup-buildx-action@v1
77-
- name: Cache amd64 Docker layers
78-
uses: actions/cache@v2
79-
with:
80-
path: /tmp/.buildx-cache/linux/amd64
81-
key: ${{ runner.os }}-buildx-linux/amd64-${{ github.sha }}
44+
uses: docker/setup-buildx-action@v3
8245
- name: Docker meta
8346
id: meta
8447
uses: docker/metadata-action@v3
8548
with:
8649
images: revoltchat/client, ghcr.io/revoltchat/client
8750
- name: Login to DockerHub
8851
uses: docker/login-action@v1
52+
if: github.event_name != 'pull_request'
8953
with:
9054
username: ${{ secrets.DOCKERHUB_USERNAME }}
9155
password: ${{ secrets.DOCKERHUB_TOKEN }}
9256
- name: Login to Github Container Registry
93-
uses: docker/login-action@v1
57+
uses: docker/login-action@v3
58+
if: github.event_name != 'pull_request'
9459
with:
9560
registry: ghcr.io
9661
username: ${{ github.actor }}
9762
password: ${{ secrets.GITHUB_TOKEN }}
9863
- name: Build and publish
99-
uses: docker/build-push-action@v2
64+
uses: docker/build-push-action@v6
10065
with:
10166
context: .
102-
push: true
67+
push: ${{ github.event_name != 'pull_request' }}
10368
platforms: linux/amd64
10469
tags: ${{ steps.meta.outputs.tags }}
10570
labels: ${{ steps.meta.outputs.labels }}
106-
cache-from: type=local,src=/tmp/.buildx-cache/linux/amd64
107-
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
108-
- name: Move cache
109-
run: |
110-
rm -rf /tmp/.buildx-cache
111-
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

0 commit comments

Comments
 (0)