Skip to content

Commit

Permalink
Enable the registry automation in prod (#254)
Browse files Browse the repository at this point in the history
This PR copies the `registry-automation` GitHub workflow (that deploys
to staging) to `registry-automation-prod` . This workflow will only run
when there is a `push` to the `main` branch.
  • Loading branch information
codingkarthik authored Aug 22, 2024
1 parent a212ae2 commit 1764219
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
60 changes: 60 additions & 0 deletions .github/workflows/registry-updates-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Update Hub DB from GH Registry (prod)

on:
push:
branches:
- main
paths:
- registry/**

jobs:
update_registry_db:
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch_depth: 1

- name: Get all connector version package changes
id: connector-version-changed-files
uses: tj-actions/changed-files@v44
with:
json: true
escape_json: false
files: |
registry/**
- name: Print out all the changed filse
env:
ADDED_FILES: ${{ steps.connector-version-changed-files.outputs.added_files }}
MODIFIED_FILES: ${{ steps.connector-version-changed-files.outputs.modified_files }}
DELETED_FILES: ${{ steps.connector-version-changed-files.outputs.deleted_files }}
run: |
echo "{\"added_files\": $ADDED_FILES, \"modified_files\": $MODIFIED_FILES, \"deleted_files\": $DELETED_FILES}" > changed_files.json
- name: List changed files
id: list_files
run: |
cat changed_files.json
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Run registry automation program
env:
CHANGED_FILES_PATH: "changed_files.json"
PUBLICATION_ENV: "production"
CONNECTOR_REGISTRY_GQL_URL: ${{ secrets.CONNECTOR_REGISTRY_GQL_URL }}
GCP_BUCKET_NAME: ${{ secrets.GCP_BUCKET_NAME }}
GCP_SERVICE_ACCOUNT_DETAILS: ${{ secrets.GCP_SERVICE_ACCOUNT_DETAILS }}
CONNECTOR_PUBLICATION_KEY: ${{ secrets.CONNECTOR_PUBLICATION_KEY }}
CLOUDINARY_URL: ${{ secrets.CLOUDINARY_URL }}
run: |
mv changed_files.json registry-automation/changed_files.json
cd registry-automation
go run main.go ci
2 changes: 1 addition & 1 deletion .github/workflows/registry-updates.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update Hub DB from GH Registry
name: Update Hub DB from GH Registry (Staging)

on:
pull_request:
Expand Down

0 comments on commit 1764219

Please sign in to comment.