Skip to content

Commit 2981401

Browse files
committed
feat: adjust image tags and build platfroms
1 parent 76e5ca6 commit 2981401

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

.github/workflows/publish_ghcr.yaml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [published]
66
push:
77
branches:
8-
- main
8+
- master
99
workflow_dispatch:
1010

1111
jobs:
@@ -30,20 +30,22 @@ jobs:
3030
username: ${{ github.actor }}
3131
password: ${{ secrets.GITHUB_TOKEN }}
3232

33-
- name: Extract metadata
34-
id: meta
35-
uses: docker/metadata-action@v4
36-
with:
37-
images: ghcr.io/${{ github.repository_owner }}/etherproxy
38-
tags: |
39-
type=ref,event=tag
40-
type=ref,event=branch
41-
type=sha
33+
- name: Get version from package.json
34+
id: package-version
35+
run: |
36+
VERSION=$(node -p "require('./package.json').version")
37+
echo "VERSION=$VERSION" >> $GITHUB_ENV
38+
echo "version=$VERSION" >> $GITHUB_OUTPUT
4239
4340
- name: Build and push Docker image
4441
uses: docker/build-push-action@v4
4542
with:
4643
context: .
4744
push: true
48-
tags: ${{ steps.meta.outputs.tags }}
49-
labels: ${{ steps.meta.outputs.labels }}
45+
platforms: linux/amd64,linux/arm64/v8
46+
tags: |
47+
ghcr.io/${{ github.repository_owner }}/etherproxy:${{ env.VERSION }}
48+
ghcr.io/${{ github.repository_owner }}/etherproxy:latest
49+
labels: |
50+
org.opencontainers.image.version=${{ env.VERSION }}
51+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}

0 commit comments

Comments
 (0)