-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(hosted): workflow_dispatch works
- Loading branch information
1 parent
4782444
commit 43522ff
Showing
1 changed file
with
12 additions
and
11 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 |
---|---|---|
|
@@ -21,7 +21,8 @@ env: | |
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
# or workflow dispatch | ||
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
|
@@ -45,25 +46,25 @@ jobs: | |
working-directory: hosted | ||
|
||
- name: Bump version if necessary | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run || github.event_name == 'workflow_dispatch' | ||
run: | | ||
env/bin/python3 bump.py bump | ||
working-directory: hosted | ||
|
||
- name: Get the version | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run || github.event_name == 'workflow_dispatch' | ||
id: get_version | ||
run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV | ||
working-directory: hosted | ||
|
||
- name: Bump service version if necessary | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run || github.event_name == 'workflow_dispatch' | ||
run: | | ||
sed -i 's/gcr.io\/embedbase\/embedbase-hosted:.*$/gcr.io\/embedbase\/embedbase-hosted:${{ env.VERSION }}/g' service.prod.yaml | ||
working-directory: hosted | ||
|
||
- name: Commit version bump | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run || github.event_name == 'workflow_dispatch' | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
|
@@ -75,17 +76,17 @@ jobs: | |
# TODO: Add tests | ||
|
||
- id: auth | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run || github.event_name == 'workflow_dispatch' | ||
uses: google-github-actions/auth@v0 | ||
with: | ||
credentials_json: "${{ secrets.GCP_SA_KEY_PROD }}" | ||
|
||
- name: Authorize Docker push | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run || github.event_name == 'workflow_dispatch' | ||
run: gcloud auth configure-docker | ||
|
||
- name: Build and push | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run || github.event_name == 'workflow_dispatch' | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: hosted | ||
|
@@ -96,7 +97,7 @@ jobs: | |
gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:latest | ||
gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ env.VERSION }} | ||
- name: Deploy to Cloud Run | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run || github.event_name == 'workflow_dispatch' | ||
id: deploy | ||
uses: google-github-actions/deploy-cloudrun@v0 | ||
with: | ||
|
@@ -106,15 +107,15 @@ jobs: | |
tag: ${{ env.VERSION }} | ||
|
||
- uses: rickstaa/action-create-tag@v1 | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run || github.event_name == 'workflow_dispatch' | ||
id: "tag_create" | ||
with: | ||
tag: hosted-${{ env.VERSION }} | ||
tag_exists_error: true | ||
message: ${{ github.event.head_commit.message }} | ||
|
||
- name: Create Release | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run | ||
if: steps.regex-match.outputs.match != '' || github.event.workflow_run || github.event_name == 'workflow_dispatch' | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: hosted-${{ env.VERSION }} | ||
|
43522ff
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.
Successfully deployed to the following URLs:
embedbase – ./dashboard
app.embedbase.xyz
embedbase.vercel.app
embedbase-git-main-prologe.vercel.app
embedbase-prologe.vercel.app
43522ff
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.
Successfully deployed to the following URLs:
embedbase-docs – ./docs
embedbase-docs-git-main-prologe.vercel.app
embedbase-docs-prologe.vercel.app
embedbase-docs-nu.vercel.app
docs.embedbase.xyz