Skip to content

Commit

Permalink
chore: publish xc-admin to ghcr (#1406)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
guibescos committed Mar 28, 2024
1 parent cd543bc commit 9328b73
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/push-xc-admin-frontend-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
26 changes: 15 additions & 11 deletions .github/workflows/push-xc-admin-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 9328b73

Please sign in to comment.