Skip to content

Commit 73d0623

Browse files
committed
docs : 修改docker CI 赋予权限
1 parent bb528c6 commit 73d0623

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

.github/workflows/docker-CI.yaml

+20-12
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,25 @@ jobs:
1717
- name: Checkout code
1818
uses: actions/checkout@v2
1919

20-
- name: Log in to GitHub Container Registry
21-
uses: docker/login-action@v2
20+
- name: Cache Docker layers
21+
uses: actions/cache@v2
2222
with:
23-
registry: ghcr.io
24-
username: ${{ github.actor }}
25-
password: ${{ secrets.GITHUB_TOKEN }}
26-
27-
- name: Build Docker image
28-
run: |
29-
docker build -t ghcr.io/irobot-algorithm/sentry_navigation:latest .
30-
31-
- name: Push Docker image
23+
path: /tmp/.buildx-cache
24+
key: ${{ runner.os }}-buildx-${{ github.sha }}
25+
restore-keys: |
26+
${{ runner.os }}-buildx-
27+
28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v1
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v1
33+
34+
- name: Login to GitHub Container Registry
35+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
36+
37+
- name: Build and push Docker images
3238
run: |
33-
docker push ghcr.io/irobot-algorithm/sentry_navigation:latest
39+
docker buildx build --platform linux/amd64,linux/arm64 \
40+
-t ghcr.io/irobot-algorithm/sentry_navigation:latest \
41+
--push .

0 commit comments

Comments
 (0)