-
Notifications
You must be signed in to change notification settings - Fork 29
59 lines (51 loc) · 2.04 KB
/
packaging.yaml
File metadata and controls
59 lines (51 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Copyright 2023 - 2024 California Department of Motor Vehicles
# Copyright 2023 - 2024 Digital Bazaar, Inc.
#
# SPDX-License-Identifier: BSD-3-Clause
name: Packaging
on:
push:
branches:
- pkg-*
tags:
- v*
jobs:
package:
runs-on: ubuntu-latest
env:
CONTAINER_OWNER: veres-containers
CONTAINER_IMAGE_NAME: opencred-platform
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Get npm package version
id: version
uses: digitalbazaar/npm-get-version-action@v1
- name: Generate next release candidate number
id: rc
uses: digitalbazaar/gh-action-buildnum@v2
with:
gist_token: ${{ secrets.VERES_BUILDER_CI_TOKEN }}
version_key: ${{ steps.version.outputs.current-version }}
- name: Compute Docker Image Tag
id: compute-tag
run: echo "tag=us.gcr.io/${{ env.CONTAINER_OWNER }}/${{ env.CONTAINER_IMAGE_NAME }}:${{ steps.version.outputs.current-version }}-${{ github.ref_name }}-${{ github.sha }}-rc${{ steps.rc.outputs.version_build_number }}" >> "$GITHUB_OUTPUT"
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.CLOUD_BUILD_GITHUB_ACTION_SA_KEY }}'
# Setup gcloud CLI
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
# Build and push image to Google Container Registry
# the --tag argument cannot be used when --config is used
# therefore TAG_NAME is passed in via --substitutions
- name: Build
run: |-
gcloud builds submit \
--quiet \
--config=cloudbuild.yaml \
--substitutions=TAG_NAME="${{ steps.compute-tag.outputs.tag }}",_NODE_AUTH_TOKEN="${{ secrets.VERES_BUILDER_CI_TOKEN }}",_VULNZ_ATTESTOR="projects/db-cloud-build/attestors/db-attestor",_VULNZ_KMS_KEY_VERSION="1",_VULNZ_KMS_KEY="db-binauthz-kms-key",_KMS_LOCATION="global",_KMS_KEYRING="db-binauthz-keyring"
- name: Display Docker Image
run: echo "${{ steps.compute-tag.outputs.tag }}"