File tree 3 files changed +72
-2
lines changed
3 files changed +72
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : GCP build and push
2
+ on :
3
+ workflow_dispatch
4
+
5
+ jobs :
6
+ release :
7
+ runs-on : lightdash-large-runner
8
+ concurrency : ${{ github.ref }}
9
+ steps :
10
+ - uses : actions/checkout@v3
11
+ with :
12
+ token : ${{ secrets.CI_GITHUB_TOKEN }}
13
+ persist-credentials : false
14
+
15
+ - id : ' auth'
16
+ uses : ' google-github-actions/auth@v2'
17
+ with :
18
+ credentials_json : ' ${{ secrets.GCP_CREDENTIALS_IMAGE_DEPLOY }}'
19
+
20
+ - name : ' Set up Cloud SDK'
21
+ uses : ' google-github-actions/setup-gcloud@v2'
22
+ with :
23
+ version : ' >= 381.0.0'
24
+
25
+ - name : ' Use gcloud CLI'
26
+ run : ' gcloud info'
27
+
28
+ - name : Build and push
29
+ run : bash ./scripts/gcp-build-and-push.sh
Original file line number Diff line number Diff line change 59
59
-d '{"ref": "main", "inputs": {"lightdash-version": "${{ steps.semantic.outputs.new_release_version }}"}}' \
60
60
https://api.github.com/repos/lightdash/helm-charts/action/workflows/increment-lightdash-app-version.yml/dispatches
61
61
- name : Trigger Sentry release
62
- if : steps.package-version.outputs.current-version != ''
62
+ if : steps.semantic.outputs.new_release_published == 'true' &&
63
+ steps.semantic.outputs.new_release_channel == null
63
64
env :
64
65
GH_TOKEN : ${{ secrets.CI_GITHUB_TOKEN }}
65
66
run : |
68
69
-H "X-GitHub-Api-Version: 2022-11-28" \
69
70
/repos/lightdash/lightdash/actions/workflows/create-sentry-release.yml/dispatches \
70
71
-f "ref=main" \
71
- -f "inputs[version]=${{ steps.package-version.outputs.current-version }}"
72
+ -f "inputs[version]=${{ steps.semantic.outputs.new_release_version }}"
73
+ - name : Trigger GCP build and push
74
+ if : steps.semantic.outputs.new_release_published == 'true' &&
75
+ steps.semantic.outputs.new_release_channel == null
76
+ env :
77
+ GH_TOKEN : ${{ secrets.CI_GITHUB_TOKEN }}
78
+ run : |
79
+ gh api --method POST \
80
+ -H "Accept: application/vnd.github+json" \
81
+ -H "X-GitHub-Api-Version: 2022-11-28" \
82
+ /repos/lightdash/lightdash/actions/workflows/gcp-build-and-push.yml/dispatches \
83
+ -f "ref=main"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ if ! command -v jq & > /dev/null
6
+ then
7
+ echo " Command 'jq' could not be found, install it with 'brew install jq' or an equivalent command"
8
+ exit 1
9
+ fi
10
+
11
+ version=$( cat package.json | jq -r ' .version' )
12
+ echo " fork version: $version "
13
+ timestamp=$( date +%Y.%m.%d-%H.%M.%S)
14
+ image=" us-east4-docker.pkg.dev/lightdash-cloud-beta/lightdash-commercial/lightdash-commercial"
15
+
16
+ echo " Building with tags: $version -commercial, beta, $timestamp "
17
+
18
+ gcloud auth configure-docker us-east4-docker.pkg.dev
19
+
20
+ docker build . -t " $image :beta" -t " $image :$timestamp " -t " $image :$version -commercial"
21
+
22
+ for tag in " $version -commercial" " beta" " $timestamp " ; do
23
+ docker push " $image :$tag "
24
+ done
25
+
26
+ # Delete images to avoid filling up disk space
27
+ for tag in " $version -commercial" " beta" " $timestamp " ; do
28
+ docker image rm " $image :$tag "
29
+ done
You can’t perform that action at this time.
0 commit comments