Skip to content

Commit b6656aa

Browse files
committed
Test upload docs
1 parent 6409218 commit b6656aa

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

.github/workflows/build-and-publish.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
push:
2020
branches:
2121
- main
22-
- 'develop**'
22+
- '*'
2323
workflow_dispatch:
2424
inputs:
2525
push-to-dev:
@@ -118,6 +118,9 @@ jobs:
118118
if: ${{ github.event.inputs.upload-docs == 'true' }}
119119
with:
120120
image_tag: 'yesdk-docserver'
121+
registry_url: 'us-docker.pkg.dev'
122+
project_id: 'support-cluster-769001'
123+
repository_name: 'yesdk'
121124
needs: build
122125

123126
publish-internal:

.github/workflows/upload-docs.yml

+16-6
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,43 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: Upload documentation
15+
name: Upload Documentation to GCP
1616

1717
on:
1818
workflow_call:
1919
inputs:
2020
image_tag:
2121
required: true
2222
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
2332

2433
jobs:
2534
upload_docs:
2635
runs-on: ubuntu-latest
2736
steps:
37+
- uses: actions/checkout@v4
2838
- uses: actions/download-artifact@v4
2939
with:
3040
name: Documentation
3141
path: Yubico.YubiKey/docs/_site/
32-
- name: Docker build nginx webserver
42+
- name: Docker build
3343
run: |
3444
docker build -t "${{ inputs.image_tag }}:${{ github.sha }}" .
3545
- name: Authenticate to GCP
3646
uses: google-github-actions/auth@v2
3747
with:
38-
workload_identity_provider: ${{ vars.GLOBAL_GCP_WORKLOAD_IDENTITY_PROVIDER }}
48+
workload_identity_provider: ${{ vars.GLOBAL_GCP_WORKLOAD_IDENTITY_PROVIDER }} # Provided at organizational level
3949
service_account: [email protected]
4050
- name: Push Docker image to GCP
4151
run: |
42-
gcloud auth configure-docker ${{ env.IMAGE_REGISTRY_URL }} --project ${{ env.IMAGE_REGISTRY_PROJECT }}
43-
docker tag "${{ inputs.image_tag }}:${{ github.sha }}" "${{ env.IMAGE_REGISTRY_URL }}/${{ env.IMAGE_REGISTRY_PROJECT }}/${{ env.IMAGE_REPOSITORY }}/${{ inputs.image_tag }}:${{ github.sha }}"
44-
docker push "${{ env.IMAGE_REGISTRY_URL }}/${{ env.IMAGE_REGISTRY_PROJECT }}/${{ env.IMAGE_REPOSITORY }}/${{ inputs.image_tag }}:${{ github.sha }}"
52+
gcloud auth configure-docker ${{ inputs.registry_url }} --project ${{ inputs.project_id }}
53+
docker tag "${{ inputs.image_tag }}:${{ github.sha }}" "${{ inputs.registry_url }}/${{ inputs.project_id }}/${{ inputs.repository_name }}/${{ inputs.image_tag }}:${{ github.sha }}"
54+
docker push "${{ inputs.registry_url }}/${{ inputs.project_id }}/${{ inputs.repository_name }}/${{ inputs.image_tag }}:${{ github.sha }}"

0 commit comments

Comments
 (0)