-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Inkvi
committed
May 8, 2024
0 parents
commit 9f71625
Showing
5 changed files
with
2,517 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
})(); | ||
} |
Oops, something went wrong.