44
55# Get deployment info
66
7- A GitHub action that gets the information needed to build and deploy an Octue service to the cloud. This information is
8- extracted and/or generated from:
7+ A GitHub action that gets the information needed to build and deploy an Octue service to the cloud from a
8+ main/production branch or a non-main/development branch. The required information is extracted and/or generated from:
99
1010- The action inputs
1111- ` git `
2525
2626 - name : Get deployment info
2727 id : get-deployment-info
28- 28+ 2929 with :
3030 gcp_project_name : test-project
3131 gcp_project_number : 1234
@@ -48,6 +48,8 @@ Outputs can be accessed in the usual way. For example, to print all the outputs:
4848 echo ${{ steps.get-deployment-info.outputs.image_version_tag }}
4949 echo ${{ steps.get-deployment-info.outputs.short_sha }}
5050 echo ${{ steps.get-deployment-info.outputs.version_slug }}
51+ echo ${{ steps.get-deployment-info.outputs.revision_tag }}
52+ echo ${{ steps.get-deployment-info.outputs.revision_tag_slug }}
5153 echo ${{ steps.get-deployment-info.outputs.gcp_environment }}
5254 echo ${{ steps.get-deployment-info.outputs.gcp_project_name }}
5355 echo ${{ steps.get-deployment-info.outputs.gcp_project_number }}
@@ -59,3 +61,22 @@ Outputs can be accessed in the usual way. For example, to print all the outputs:
5961
6062Note: there's no need to print the outputs for debugging in practice - the action prints them to ` stdout` for this very
6163purpose.
64+
65+ # # Main vs non-main branch deployments
66+
67+ Some of the outputs' values depend on whether the action is run on the `main` branch or a non-`main` branch.
68+
69+ # ## Main branch deployments
70+
71+ - ` revision_tag` is `<version>`
72+ - ` image_version_tag` is `main-<version>`
73+ - ` image_latest_tag` is `main-latest`
74+
75+ # ## Non-main branch deployments
76+
77+ The truncated branch name (first 12 characters) is used to ensure service names are short enough to be accepted by e.g.
78+ Cloud Run without having to restrict the length of branch names.
79+
80+ - ` revision_tag` is `pull-<truncated branch_tag_kebab>`
81+ - ` image_version_tag` is `pull-<truncated branch_tag_kebab>`
82+ - ` image_latest_tag` is `pull-<truncated branch_tag_kebab>-latest`
0 commit comments