-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[platform] GitHub Actions workflow to deploy TDA
- Loading branch information
Showing
2 changed files
with
68 additions
and
2 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,64 @@ | ||
name: deploy_tda.yml | ||
run-name: triggered by ${{ github.actor }} | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
# Only run 1 workflow at a time. If new one starts abort any that are already running. | ||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
default-job: | ||
if: github.repository_owner == 'sentry-demos' # don't run in forks | ||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- run: echo "Triggered by ${{ github.event_name }} event." | ||
- run: echo "Branch is ${{ github.ref }}" | ||
|
||
- name: Check out this repository code | ||
uses: actions/checkout@v3 | ||
with: | ||
path: empower | ||
fetch-depth: 0 | ||
|
||
- name: Check out `empower-config` to get GCP identity provider and account name | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: sentry-demos/empower-config | ||
path: empower-config | ||
token: ${{ secrets.KOSTY_PERSONAL_ACCESS_TOKEN_FOR_SYNC_DEPLOY_FORK }} | ||
# See https://github.com/actions/checkout/issues/347#issuecomment-963586784 | ||
|
||
- name: Get GCP_ env variables from empower-config/.gcloudrc | ||
run: | | ||
source empower-config/.gcloudrc | ||
echo "GCP_WORKLOAD_IDENTITY_PROVIDER=$GCP_WORKLOAD_IDENTITY_PROVIDER" >> $GITHUB_OUTPUT | ||
echo "GCP_SERVICE_ACCOUNT=$GCP_SERVICE_ACCOUNT" >> $GITHUB_OUTPUT | ||
id: gcloudrc | ||
|
||
- name: Copy .sauce_credentials from empower-config repo | ||
run: cp empower-config/.sauce_credentials empower/tda/ | ||
|
||
- id: 'auth' | ||
name: 'Authenticate Google Cloud' | ||
uses: 'google-github-actions/auth@v2' | ||
with: | ||
workload_identity_provider: ${{ steps.gcloudrc.outputs.GCP_WORKLOAD_IDENTITY_PROVIDER }} | ||
service_account: ${{ steps.gcloudrc.outputs.GCP_SERVICE_ACCOUNT }} | ||
|
||
- name: 'Set up Google Cloud SDK' | ||
uses: 'google-github-actions/setup-gcloud@v2' | ||
|
||
- name: Run deploy_tda.sh | ||
run: gcloud compute config-ssh && ./deploy_tda.sh | ||
working-directory: ./empower/tda | ||
|
||
- run: echo "Job status is ${{ job.status }}." | ||
|
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