-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add GH workflow to apply infra (#3470)
* feat: add GH workflow to apply infra * wip * only if on main --------- Co-authored-by: Henry Fontanier <henry@dust.tt>
- Loading branch information
1 parent
efb3f3b
commit f9afdeb
Showing
1 changed file
with
52 additions
and
0 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,52 @@ | ||
name: Apply Infra | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: apply_infra | ||
cancel-in-progress: false | ||
|
||
env: | ||
GCLOUD_PROJECT_ID: ${{ secrets.GCLOUD_PROJECT_ID }} | ||
DD_API_KEY: ${{ secrets.DD_API_KEY }} | ||
DD_APP_KEY: ${{ secrets.DD_APP_KEY }} | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get short sha | ||
id: short_sha | ||
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
|
||
- name: "Authenticate with Google Cloud" | ||
uses: "google-github-actions/auth@v1" | ||
with: | ||
credentials_json: "${{ secrets.GCLOUD_SA_KEY }}" | ||
|
||
- name: "Set up Cloud SDK" | ||
uses: "google-github-actions/setup-gcloud@v1" | ||
|
||
- name: Install gke-gcloud-auth-plugin | ||
run: | | ||
gcloud components install gke-gcloud-auth-plugin | ||
- name: Setup kubectl | ||
run: | | ||
gcloud container clusters get-credentials dust-kube --region us-central1 | ||
- name: Install yq | ||
run: | | ||
wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 | ||
chmod a+x /usr/local/bin/yq | ||
- name: Run Apply Infra | ||
run: | | ||
cd k8s | ||
./apply_infra.sh |