Skip to content

Commit a0d93e2

Browse files
authored
ci: leverage GitHub Actions caches in CI (#60)
cf. https://docs.docker.com/build/ci/github-actions/cache/
1 parent 1f0b619 commit a0d93e2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ jobs:
7777
workdir: src/main/
7878
targets: dev
7979
load: true # Required for tests in later steps
80+
set: |
81+
*.cache-from=type=gha,timeout=20s
82+
*.cache-to=type=gha,mode=max,timeout=20s
8083
8184
- name: Test
8285
run: src/test/test.sh

src/main/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# You should have received a copy of the GNU General Public License
1818
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1919

20+
# TODO: what about an alpine variant?
2021
FROM docker.io/ubuntu:noble@sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782 AS build
2122

2223
ARG MINECRAFT_VERSION
@@ -64,12 +65,12 @@ USER papermc
6465

6566
WORKDIR /home/papermc
6667

67-
# Copy the PaperMC server
68-
COPY --from=build --chown=papermc --chmod=500 /build/papermc-server-*.jar ./
69-
7068
# Copy license file
7169
ADD --chmod=444 https://raw.githubusercontent.com/Djaytan/docker-papermc-server/refs/heads/main/LICENSE.md .
7270

71+
# Copy the PaperMC server
72+
COPY --from=build --chown=papermc --chmod=500 /build/papermc-server-*.jar ./
73+
7374
# Copy the configuration files
7475
# Write access is required by PaperMC to update the configuration files
7576
# even tho we would prefer otherwise in containers (read-only access for immutability enforcement)

0 commit comments

Comments
 (0)