This repository was archived by the owner on May 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
feat: ci to build new registry on push to main #363
Merged
bcpeinhardt
merged 21 commits into
main
from
bcpeinhardt/ci-to-build-new-registry-on-push-to-main
Dec 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
f52b8ca
add ci to trigger build of registry-v2 init commit
bcpeinhardt 3e2128c
fix mixedup scripts
bcpeinhardt df92e31
add current branch to branch triggers to test action
bcpeinhardt 233775e
make deploy script executable. Action should still fail with secrets …
bcpeinhardt ca69c68
test with secrets as nonsense values to make sure they aren't logged …
bcpeinhardt 1d9288a
alright let's try this out
bcpeinhardt 0b73692
remove test branch from trigger branches list
bcpeinhardt 374e8de
warnings
bcpeinhardt ee83bb2
add the fail flag to hide the body as well in case it contains the UR…
bcpeinhardt 58ab394
use github action instead of script to run new builds
bcpeinhardt e86e50c
add this branch to workflow to trigger build
bcpeinhardt d9622e5
try id-token perm
bcpeinhardt c262bec
maybe this will do it
bcpeinhardt e8461fd
take that
bcpeinhardt e36e66b
I will best you google cloud
bcpeinhardt 3b04b61
cmon you can do it
bcpeinhardt 48b9b5b
maybe now
bcpeinhardt 236439c
set project id
bcpeinhardt 41a89e2
how bout now
bcpeinhardt
8000
Dec 19, 2024
86d144e
remove testing branch
bcpeinhardt 019c690
Merge branch 'main' into bcpeinhardt/ci-to-build-new-registry-on-push…
bcpeinhardt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
add ci to trigger build of registry-v2 init commit
- Loading branch information
commit f52b8ca6e1893c71bb6a50b99a34430c8f154b18
There are no files selected for viewing
This file contains hidden or 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,33 @@ | ||
#!/usr/bin/env bash | ||
set -o pipefail | ||
set -u | ||
|
||
VERBOSE="${VERBOSE:-0}" | ||
if [[ "${VERBOSE}" -ne "0" ]]; then | ||
set -x | ||
fi | ||
|
||
# List of required environment variables | ||
required_vars=( | ||
"GCLOUD_API_KEY" | ||
"GCLOUD_PROD_DEPLOY_SECRET" | ||
"GCLOUD_DEV_DEPLOY_SECRET" | ||
) | ||
|
||
# Check if each required variable is set | ||
for var in "${required_vars[@]}"; do | ||
if [[ -z "${!var:-}" ]]; then | ||
echo "Error: Environment variable '$var' is not set." | ||
exit 1 | ||
fi | ||
done | ||
|
||
# Trigger a build for dev | ||
curl -X POST "https://cloudbuild.googleapis.com/v1/projects/coder-registry-1/triggers/http-build-registry-v2-dev:webhook?key=${GCLOUD_API_KEY}&secret=${GCLOUD_DEV_DEPLOY_SECRET}" \ | ||
-H "Content-Type: application/json" \ | ||
-d '{}' | ||
|
||
# Trigger a build for prod | ||
curl -X POST "https://cloudbuild.googleapis.com/v1/projects/coder-registry-1/triggers/http-build-registry-v2-trigger:webhook?key=${GCLOUD_API_KEY}&secret=${GCLOUD_PROD_DEPLOY_SECRET}" \ | ||
-H "Content-Type: application/json" \ | ||
-d '{}' |
This file contains hidden or 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
This file contains hidden or 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,25 @@ | ||
name: deploy-registry | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run check.sh | ||
run: | | ||
./.github/scripts/check.sh | ||
env: | ||
GCLOUD_API_KEY: ${{ secrets.GCLOUD_API_KEY }} | ||
GCLOUD_PROD_DEPLOY_SECRET: ${{ secrets.GCLOUD_PROD_DEPLOY_SECRET }} | ||
GCLOUD_DEV_DEPLOY_SECRET: ${{ secrets.GCLOUD_DEV_DEPLOY_SECRET }} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to deploy on each PR too?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I should pull that out, was moving too quickly, good catch 🙏