Skip to content

Commit 9328b73

Browse files
authored
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
1 parent cd543bc commit 9328b73

File tree

3 files changed

+28
-26
lines changed

3 files changed

+28
-26
lines changed

.github/workflows/push-xc-admin-frontend-image.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ on:
66
permissions:
77
contents: read
88
id-token: write
9+
packages: write
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: pyth-network/xc-admin-frontend
913
jobs:
10-
xc-admin-image:
14+
xc-admin-frontend-image:
1115
runs-on: ubuntu-latest
1216
steps:
1317
- uses: actions/checkout@v2
@@ -16,23 +20,17 @@ jobs:
1620
SHORT_HASH=$(echo ${{ github.sha }} | cut -c1-7)
1721
TIMESTAMP=$(date +%s)
1822
echo "IMAGE_TAG=${TIMESTAMP}-${SHORT_HASH}" >> "${GITHUB_ENV}"
19-
- uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1
23+
- name: Log in to the Container registry
24+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
2025
with:
21-
role-to-assume: arn:aws:iam::192824654885:role/github-actions-ecr
22-
aws-region: eu-west-2
23-
- uses: aws-actions/amazon-ecr-login@v1
24-
id: ecr_login
26+
registry: ${{ env.REGISTRY }}
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
2529
- name: Build docker image
2630
run: |
2731
DOCKER_BUILDKIT=1 docker build -t lerna -f Dockerfile.lerna .
28-
DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f governance/xc_admin/packages/xc_admin_frontend/Dockerfile .
29-
env:
30-
ECR_REGISTRY: ${{ steps.ecr_login.outputs.registry }}
31-
ECR_REPOSITORY: xc-admin-frontend
32+
DOCKER_BUILDKIT=1 docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} -f governance/xc_admin/packages/xc_admin_frontend/Dockerfile .
3233
- name: Push docker image
3334
if: github.ref == 'refs/heads/main'
3435
run: |
35-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
36-
env:
37-
ECR_REGISTRY: ${{ steps.ecr_login.outputs.registry }}
38-
ECR_REPOSITORY: xc-admin-frontend
36+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}

.github/workflows/push-xc-admin-image.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
permissions:
77
contents: read
88
id-token: write
9+
packages: write
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: pyth-network/xc-admin
913
jobs:
1014
xc-admin-image:
1115
runs-on: ubuntu-latest
@@ -17,16 +21,16 @@ jobs:
1721
PREFIX="refs/tags/xc-admin-"
1822
VERSION="${GITHUB_REF:${#PREFIX}}"
1923
echo "IMAGE_TAG=${VERSION}" >> "${GITHUB_ENV}"
20-
- uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1
24+
- name: Log in to the Container registry
25+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
2126
with:
22-
role-to-assume: arn:aws:iam::192824654885:role/github-actions-ecr
23-
aws-region: eu-west-2
24-
- uses: aws-actions/amazon-ecr-login@v1
25-
id: ecr_login
26-
- run: |
27+
registry: ${{ env.REGISTRY }}
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
- name: Build docker image
31+
run: |
2732
DOCKER_BUILDKIT=1 docker build -t lerna -f Dockerfile.lerna .
28-
DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f governance/xc_admin/Dockerfile .
29-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
30-
env:
31-
ECR_REGISTRY: ${{ steps.ecr_login.outputs.registry }}
32-
ECR_REPOSITORY: xc-admin
33+
DOCKER_BUILDKIT=1 docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} -f governance/xc_admin/Dockerfile .
34+
- name: Push docker image
35+
run: |
36+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}

governance/xc_admin/packages/xc_admin_frontend/pages/_app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const walletConnectConfig: WalletConnectWalletAdapterConfig = {
3232
relayUrl: 'wss://relay.walletconnect.com',
3333
projectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID,
3434
metadata: {
35-
name: 'Pyth Proposals',
35+
name: 'Pyth Proposals Page',
3636
description: 'Vote on Pyth Improvement Proposals',
3737
url: 'https://proposals.pyth.network/',
3838
icons: ['https://pyth.network/token.svg'],

0 commit comments

Comments
 (0)