@@ -16,22 +16,17 @@ name: Upload documentation to GCP
16
16
17
17
on :
18
18
workflow_call :
19
- inputs :
20
- image_tag :
21
- required : true
22
- type : string
23
- registry_url :
24
- required : true
25
- type : string
26
- project_id :
27
- required : true
28
- type : string
29
- repository_name :
30
- required : true
31
- type : string
32
-
19
+
33
20
permissions :
34
21
id-token : write
22
+ contents : read
23
+
24
+ env :
25
+ image_tag : ' yesdk-docserver'
26
+ registry_url : ' us-docker.pkg.dev'
27
+ project_id : ' support-cluster-769001'
28
+ repository_name : ' yesdk'
29
+ service_account :
[email protected]
35
30
36
31
jobs :
37
32
upload_docs :
@@ -44,14 +39,16 @@ jobs:
44
39
path : Yubico.YubiKey/docs/_site/
45
40
- name : Build nginx image for documentation
46
41
run : |
47
- docker build -t "${{ inputs.image_tag }}:${{ github.sha }}" .
42
+ docker build -t "${{ env.image_tag }}:${{ github.sha }}" .
43
+
48
44
- name : Authenticate to GCP
49
45
uses : google-github-actions/auth@v2
50
46
with :
51
47
workload_identity_provider : ${{ vars.GLOBAL_GCP_WORKLOAD_IDENTITY_PROVIDER }} # Provided at organizational level
52
- service_account :
[email protected]
48
+ service_account : $${{ env.service_account }}
53
49
- name : Push Docker image to GCP
54
50
run : |
55
- gcloud auth configure-docker ${{ inputs.registry_url }} --project ${{ inputs.project_id }}
56
- docker tag "${{ inputs.image_tag }}:${{ github.sha }}" "${{ inputs.registry_url }}/${{ inputs.project_id }}/${{ inputs.repository_name }}/${{ inputs.image_tag }}:${{ github.sha }}"
57
- docker push "${{ inputs.registry_url }}/${{ inputs.project_id }}/${{ inputs.repository_name }}/${{ inputs.image_tag }}:${{ github.sha }}"
51
+ gcloud auth configure-docker ${{ env.registry_url }} --project ${{ env.project_id }}
52
+ docker tag "${{ env.image_tag }}:${{ github.sha }}" "${{ env.registry_url }}/${{ env.project_id }}/${{ env.repository_name }}/${{ env.image_tag }}:${{ github.sha }}"
53
+ docker push "${{ env.registry_url }}/${{ env.project_id }}/${{ env.repository_name }}/${{ env.image_tag }}:${{ github.sha }}"
54
+ echo "New image tag: ${{ github.sha }}"
0 commit comments