@@ -24,7 +24,7 @@ Before proceeding, ensure the following:
24
24
- ** Coder CLI** is installed and configured in your environment.
25
25
- ** Terraform CLI** is installed and available in your CI environment.
26
26
- Access to your ** Coder instance** with the appropriate
27
- [ permissions] ( ../admin/users/groups-roles#roles ) .
27
+ [ permissions] ( ../admin/users/groups-roles.md #roles ) .
28
28
29
29
## Example GitHub Action Workflow
30
30
@@ -44,8 +44,8 @@ workspace creation.
44
44
45
45
### Workflow File
46
46
47
- Save the following workflow file as ` .github/workflows/template-ci .yaml ` in your
48
- repository:
47
+ Save the following workflow file as ` .github/workflows/publish-template .yaml ` in
48
+ your repository:
49
49
50
50
``` yaml
51
51
name : Test and Publish Coder Template
59
59
jobs :
60
60
test-and-publish :
61
61
runs-on : ubuntu-latest
62
- env:
63
- TEMPLATE_NAME: "my-template"
62
+ env :
63
+ TEMPLATE_NAME : " my-template"
64
64
steps :
65
65
- name : Checkout repository
66
66
uses : actions/checkout@v4
73
73
- name : Set up Coder CLI
74
74
uses : coder/setup-action@v1
75
75
with :
76
- access_url : ' https://coder.example.com'
77
- coder_session_token: ${{ secrets.CODER_SESSION_TOKEN }}
76
+ access_url : " https://coder.example.com"
77
+ coder_session_token : ${{ secrets.CODER_SESSION_TOKEN }}
78
78
79
79
- name : Validate Terraform template
80
80
run : terraform validate
@@ -85,11 +85,13 @@ jobs:
85
85
86
86
- name : Get latest commit title to use as template version description
87
87
id : message
88
- run : echo "pr_title=$(git log --format=%s -n 1 ${{ github.sha }})" >> $GITHUB_OUTPUT
88
+ run :
89
+ echo "pr_title=$(git log --format=%s -n 1 ${{ github.sha }})" >>
90
+ $GITHUB_OUTPUT
89
91
90
92
- name : Push template to Coder
91
93
run : |
92
- coder templates push $TEMPLATE_NAME --activate=false --name ${{ steps.name.outputs.version_name }} --message ${{ steps.message.outputs.pr_title }} --yes
94
+ coder templates push $TEMPLATE_NAME --activate=false --name ${{ steps.name.outputs.version_name }} --message " ${{ steps.message.outputs.pr_title }}" --yes
93
95
94
96
- name : Create a test workspace
95
97
run : |
99
101
if : success()
100
102
run : |
101
103
coder template version promote --template=$TEMPLATE_NAME --template-version=${{ steps.name.outputs.version_name }} --yes
102
-
103
104
` ` `
0 commit comments