Forráskód Böngészése

chore: publish xc-admin to ghcr (#1406)

* perf: use solana hash precompile

* chore: xc-admin push to ghcr

* Trigger CI

* Check

* Fix

* Fix boolean

* Fix env variable

* Go

* Push new worflow

* Cleanup

* Go:

* Add packages write
guibescos 1 éve
szülő
commit
9328b73284

+ 12 - 14
.github/workflows/push-xc-admin-frontend-image.yml

@@ -6,8 +6,12 @@ on:
 permissions:
   contents: read
   id-token: write
+  packages: write
+env:
+  REGISTRY: ghcr.io
+  IMAGE_NAME: pyth-network/xc-admin-frontend
 jobs:
-  xc-admin-image:
+  xc-admin-frontend-image:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2
@@ -16,23 +20,17 @@ jobs:
           SHORT_HASH=$(echo ${{ github.sha }} | cut -c1-7)
           TIMESTAMP=$(date +%s)
           echo "IMAGE_TAG=${TIMESTAMP}-${SHORT_HASH}" >> "${GITHUB_ENV}"
-      - uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1
+      - name: Log in to the Container registry
+        uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
         with:
-          role-to-assume: arn:aws:iam::192824654885:role/github-actions-ecr
-          aws-region: eu-west-2
-      - uses: aws-actions/amazon-ecr-login@v1
-        id: ecr_login
+          registry: ${{ env.REGISTRY }}
+          username: ${{ github.actor }}
+          password: ${{ secrets.GITHUB_TOKEN }}
       - name: Build docker image
         run: |
           DOCKER_BUILDKIT=1 docker build -t lerna -f Dockerfile.lerna .
-          DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f governance/xc_admin/packages/xc_admin_frontend/Dockerfile .
-        env:
-          ECR_REGISTRY: ${{ steps.ecr_login.outputs.registry }}
-          ECR_REPOSITORY: xc-admin-frontend
+          DOCKER_BUILDKIT=1 docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} -f governance/xc_admin/packages/xc_admin_frontend/Dockerfile .
       - name: Push docker image
         if: github.ref == 'refs/heads/main'
         run: |
-          docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
-        env:
-          ECR_REGISTRY: ${{ steps.ecr_login.outputs.registry }}
-          ECR_REPOSITORY: xc-admin-frontend
+          docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}

+ 15 - 11
.github/workflows/push-xc-admin-image.yml

@@ -6,6 +6,10 @@ on:
 permissions:
   contents: read
   id-token: write
+  packages: write
+env:
+  REGISTRY: ghcr.io
+  IMAGE_NAME: pyth-network/xc-admin
 jobs:
   xc-admin-image:
     runs-on: ubuntu-latest
@@ -17,16 +21,16 @@ jobs:
           PREFIX="refs/tags/xc-admin-"
           VERSION="${GITHUB_REF:${#PREFIX}}"
           echo "IMAGE_TAG=${VERSION}" >> "${GITHUB_ENV}"
-      - uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1
+      - name: Log in to the Container registry
+        uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
         with:
-          role-to-assume: arn:aws:iam::192824654885:role/github-actions-ecr
-          aws-region: eu-west-2
-      - uses: aws-actions/amazon-ecr-login@v1
-        id: ecr_login
-      - run: |
+          registry: ${{ env.REGISTRY }}
+          username: ${{ github.actor }}
+          password: ${{ secrets.GITHUB_TOKEN }}
+      - name: Build docker image
+        run: |
           DOCKER_BUILDKIT=1 docker build -t lerna -f Dockerfile.lerna .
-          DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f governance/xc_admin/Dockerfile .
-          docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
-        env:
-          ECR_REGISTRY: ${{ steps.ecr_login.outputs.registry }}
-          ECR_REPOSITORY: xc-admin
+          DOCKER_BUILDKIT=1 docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} -f governance/xc_admin/Dockerfile .
+      - name: Push docker image
+        run: |
+          docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}

+ 1 - 1
governance/xc_admin/packages/xc_admin_frontend/pages/_app.tsx

@@ -32,7 +32,7 @@ const walletConnectConfig: WalletConnectWalletAdapterConfig = {
     relayUrl: 'wss://relay.walletconnect.com',
     projectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID,
     metadata: {
-      name: 'Pyth Proposals',
+      name: 'Pyth Proposals Page',
       description: 'Vote on Pyth Improvement Proposals',
       url: 'https://proposals.pyth.network/',
       icons: ['https://pyth.network/token.svg'],