Skip to content

Commit

Permalink
chore(hosted): workflow_dispatch works
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed May 30, 2023
1 parent 4782444 commit 43522ff
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/release_hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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]
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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 }}
Expand Down

2 comments on commit 43522ff

@vercel
Copy link

@vercel vercel bot commented on 43522ff May 30, 2023

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

@vercel
Copy link

@vercel vercel bot commented on 43522ff May 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.