Skip to content

Commit

Permalink
Testing service account
Browse files Browse the repository at this point in the history
  • Loading branch information
Inkvi committed May 8, 2024
0 parents commit 9f71625
Show file tree
Hide file tree
Showing 5 changed files with 2,517 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: docker-publish

on:
push:
tags:
- "v*.*.*"

env:
IMAGE_NAME: ghcr.io/polymerdao/signer-service

jobs:
docker-build-signer-service:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.build-ref }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.IMAGE_NAME }}
tags: |
type=sha
type=semver,pattern={{raw}}
labels: |
org.opencontainers.image.source=https://github.com/polymerdao/signer-service
org.opencontainers.image.title=signer-service
org.opencontainers.image.url=https://github.com/polymerdao/signer-service
- name: Authenticate Docker
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
push: true
file: Dockerfile
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Use the official Node.js 14 image as a base
FROM node:18-alpine

# Set the working directory in the container
WORKDIR /app

# Copy package.json and package-lock.json (if available)
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application code
COPY main.ts .

RUN npm install -g ts-node

CMD ["ts-node", "main.ts"]

23 changes: 23 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const {KeyManagementServiceClient} = require('@google-cloud/kms');


if (require.main === module) {
(async () => {
const client = new KeyManagementServiceClient();
const locationName = client.locationPath("polymer-testnet-376705", "global");

async function listKeyRings() {
const [keyRings] = await client.listKeyRings({
parent: locationName,
});

for (const keyRing of keyRings) {
console.log(keyRing.name);
}

return keyRings;
}

return listKeyRings();
})();
}
Loading

0 comments on commit 9f71625

Please sign in to comment.