forked from solana-labs/solana-ping-api
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
8991bc7
commit c0ff0ca
Showing
14 changed files
with
345 additions
and
205 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,31 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '[Bug]' | ||
labels: bug | ||
assignees: ngundotra | ||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
|
||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Example Links** | ||
|
||
- [Please provide at least 1 link here](https://explorer.solana.com) | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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,61 @@ | ||
name: 'Deploy to Cloud Run' | ||
description: 'Deploys a service or job to Cloud Run with optional immediate execution for jobs' | ||
|
||
inputs: | ||
environment: | ||
required: true | ||
description: 'Deployment environment' | ||
default: 'dev' | ||
repository: | ||
required: true | ||
description: 'Artifact repository' | ||
default: 'artifacts-0' | ||
project-name: | ||
required: true | ||
description: 'Name of the project' | ||
gcp-project-id: | ||
required: true | ||
description: 'Google Cloud Project ID' | ||
app-name: | ||
required: true | ||
description: 'Name of the application' | ||
gcp-auth-key: | ||
required: true | ||
description: 'GCP authentication key' | ||
image-name: | ||
required: true | ||
description: 'Name of the Docker image' | ||
deploy-type: | ||
required: true | ||
default: service | ||
description: 'Type of deployment: "service" or "job"' | ||
execute-immediately: | ||
required: false | ||
default: "false" | ||
description: 'Whether to execute the job immediately after deployment (only for jobs)' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- shell: bash | ||
run: echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" | ||
|
||
- uses: google-github-actions/auth@v2 | ||
with: | ||
credentials_json: ${{ inputs.gcp-auth-key }} | ||
|
||
- uses: google-github-actions/setup-gcloud@v2 | ||
|
||
- uses: google-github-actions/deploy-cloudrun@v2 | ||
with: | ||
project_id: ${{ inputs.gcp-project-id }} | ||
${{ inputs.deploy-type == 'job' && 'job' || 'service' }}: ${{ inputs.app-name }} | ||
image: us-central1-docker.pkg.dev/${{ inputs.repository }}/${{ inputs.project-name }}/${{ inputs.image-name }}:sha-${{ env.sha_short }} | ||
|
||
- name: Execute Job Immediately | ||
if: inputs.deploy-type == 'job' && inputs.execute-immediately == 'true' | ||
shell: bash | ||
run: | | ||
gcloud run jobs execute ${{ inputs.app-name }} \ | ||
--project ${{ inputs.gcp-project-id }} \ | ||
--region us-central1 |
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,64 @@ | ||
name: 'Build and Release Docker image' | ||
description: '' | ||
|
||
inputs: | ||
repository: | ||
required: true | ||
description: '' | ||
default: 'artifacts-0' | ||
project-name: | ||
required: true | ||
description: '' | ||
app-name: | ||
required: true | ||
description: '' | ||
default: '' | ||
gcp-auth-key: | ||
required: true | ||
description: '' | ||
default: '' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: mobiledevops/secret-to-file-action@v1 | ||
with: | ||
base64-encoded-secret: ${{ secrets.CONFIG_YAML }} | ||
filename: "config.yaml" | ||
is-executable: false | ||
working-directory: "./" | ||
- uses: mobiledevops/secret-to-file-action@v1 | ||
with: | ||
base64-encoded-secret: ${{ secrets.CONFIG_ATLASNET_YAML }} | ||
filename: "config-atlasnet.yaml" | ||
is-executable: false | ||
working-directory: "./" | ||
- uses: mobiledevops/secret-to-file-action@v1 | ||
with: | ||
base64-encoded-secret: ${{ secrets.ID_JSON }} | ||
filename: "id.json" | ||
is-executable: false | ||
working-directory: "./" | ||
- uses: docker/metadata-action@v5 | ||
id: metadata | ||
with: | ||
images: us-central1-docker.pkg.dev/${{ inputs.repository }}/${{ inputs.project-name }}/${{ inputs.app-name }} | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
type=sha | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- uses: docker/login-action@v3 | ||
with: | ||
username: _json_key | ||
password: '${{ inputs.gcp-auth-key }}' | ||
registry: 'us-central1-docker.pkg.dev' | ||
- uses: int128/kaniko-action@v1 | ||
with: | ||
push: true | ||
file: Dockerfile | ||
tags: ${{ steps.metadata.outputs.tags }} | ||
labels: ${{ steps.metadata.outputs.labels }} | ||
cache: true |
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,21 @@ | ||
version: 2 | ||
registries: | ||
npmjs: | ||
type: npm-registry | ||
url: https://registry.npmjs.org | ||
token: ${{secrets.NPM_TOKEN}} | ||
updates: | ||
- package-ecosystem: "docker" | ||
directory: "/docker" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "npm" | ||
registries: | ||
- npmjs | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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,12 @@ | ||
name: Auto approve | ||
|
||
on: pull_request_target | ||
|
||
jobs: | ||
auto-approve: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
if: github.actor == 'dependabot[bot]' | ||
steps: | ||
- uses: hmarr/auto-approve-action@v4 |
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,29 @@ | ||
name: deploy | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
environment: | ||
required: true | ||
type: string | ||
secrets: | ||
GCP_AUTH_KEY: | ||
required: true | ||
jobs: | ||
|
||
|
||
deploy-ping: | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/deploy | ||
with: | ||
deploy-type: service | ||
environment: ${{ inputs.environment }} | ||
gcp-project-id: fuzzy-lemur-${{ inputs.environment }} | ||
gcp-auth-key: ${{ secrets.GCP_AUTH_KEY }} | ||
repository: "artifacts-0" | ||
project-name: "atlasnet" | ||
app-name: "ping-api" | ||
image-name: "ping" |
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,24 @@ | ||
name: deploy | ||
|
||
on: | ||
push: | ||
branches: [ 'main' ] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/release | ||
with: | ||
repository: "artifacts-0" | ||
project-name: "atlasnet" | ||
app-name: "ping" | ||
gcp-auth-key: ${{ secrets.GCP_AUTH_KEY }} | ||
|
||
deploy-test: | ||
needs: [ release ] | ||
uses: ./.github/workflows/deploy-app.yml | ||
with: | ||
environment: 'test' | ||
secrets: inherit |
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,20 @@ | ||
name: build-lint-test | ||
|
||
on: | ||
merge_group: | ||
pull_request: | ||
branches: ['main'] | ||
types: [synchronize, opened, reopened] | ||
|
||
jobs: | ||
|
||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/release | ||
with: | ||
repository: 'artifacts-0' | ||
project-name: 'atlasnet' | ||
app-name: 'ping' | ||
gcp-auth-key: ${{ secrets.GCP_AUTH_KEY }} |
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 |
---|---|---|
|
@@ -30,3 +30,6 @@ config-devnet.yaml | |
# Go workspace file | ||
go.work.* | ||
|
||
id.json | ||
config-atlasnet.yaml | ||
.idea/ |
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,16 @@ | ||
FROM golang:1.22 AS builder | ||
WORKDIR /workspace | ||
COPY . . | ||
RUN go build -o app . | ||
|
||
FROM debian:latest | ||
RUN \ | ||
apt-get update && \ | ||
apt-get install ca-certificates curl vim -y | ||
WORKDIR /workspace | ||
COPY --from=builder /workspace/app . | ||
COPY --from=builder /workspace/config.yaml . | ||
COPY --from=builder /workspace/config-atlasnet.yaml . | ||
COPY --from=builder /workspace/id.json . | ||
|
||
CMD ["./app"] |
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
Oops, something went wrong.