Skip to content

Commit 1af00b8

Browse files
committed
修改: .github/workflows/docker-build.yml
1 parent 610459b commit 1af00b8

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- main
77

8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: routeros-pyscript
11+
812
jobs:
913
build:
1014
runs-on: ubuntu-latest
@@ -13,14 +17,19 @@ jobs:
1317
- name: Checkout code
1418
uses: actions/checkout@v2
1519

20+
- name: Lowercase Owner
21+
id: lowercase
22+
run: |
23+
echo "OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
24+
1625
- name: Set up Docker Buildx
1726
uses: docker/setup-buildx-action@v1
1827

1928
- name: Log in to GitHub Container Registry
2029
uses: docker/login-action@v2
2130
with:
22-
registry: ghcr.io
23-
username: naclwww
31+
registry: ${{ env.REGISTRY }}
32+
username: ${{ github.actor }}
2433
password: ${{ secrets.GITHUB_TOKEN }}
2534

2635
- name: Build and push Docker image
@@ -30,7 +39,6 @@ jobs:
3039
file: ./Dockerfile
3140
platforms: linux/amd64,linux/arm64,linux/arm/v7
3241
push: true
33-
tags: ghcr.io/${{ github.repository_owner }}/routeros-pyscript:latest
42+
tags: ${{ env.REGISTRY }}/${{ steps.lowercase.outputs.OWNER }}/${{ env.IMAGE_NAME }}:latest
3443
build-args: |
3544
BUILDKIT_INLINE_CACHE=1
36-
outputs: type=image,name=${{ env.REGISTRY }}/naclwww/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,compression=gzip,compress=true,push=${{ github.event_name != 'pull_request' }}

0 commit comments

Comments
 (0)