Skip to content

Commit e79a70b

Browse files
authored
Merge pull request #376 from PassiveLemon/actions-cache
Add layer caching to Docker action
2 parents 9cb315e + 779115d commit e79a70b

File tree

2 files changed

+43
-40
lines changed

2 files changed

+43
-40
lines changed

.github/workflows/docker.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build and push Docker image
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
7+
jobs:
8+
setup-build-push:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
with:
14+
ref: ${{ github.event.release.tag_name }}
15+
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
22+
- name: Login to Docker Hub
23+
uses: docker/login-action@v3
24+
with:
25+
username: ${{ secrets.DOCKER_USERNAME }}
26+
password: ${{ secrets.DOCKER_PASSWORD }}
27+
28+
- name: Setup building file structure
29+
run: |
30+
cp -lr $GITHUB_WORKSPACE/src/ $GITHUB_WORKSPACE/docker/
31+
32+
- name: Build and push Docker image
33+
uses: docker/build-push-action@v6
34+
with:
35+
context: ./docker
36+
push: true
37+
platforms: linux/amd64,linux/arm64
38+
tags: |
39+
zoraxydocker/zoraxy:latest
40+
zoraxydocker/zoraxy:${{ github.event.release.tag_name }}
41+
cache-from: type=gha
42+
cache-to: type=gha,mode=max
43+

.github/workflows/main.yml

-40
This file was deleted.

0 commit comments

Comments
 (0)