-
Notifications
You must be signed in to change notification settings - Fork 2
118 lines (112 loc) · 3.55 KB
/
Copy pathreusable_deploy-artifacts.yaml
File metadata and controls
118 lines (112 loc) · 3.55 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Deploy to Artifactory
on:
workflow_call:
inputs:
project:
description: JFrog Artifactory project name
required: true
type: string
build-name:
description: JFrog build name
required: true
type: string
version:
description: Version of the artifact to upload
required: true
type: string
artifactory-url:
required: false
description: JFrog Artifactory URL
type: string
default: https://artifact.aerospike.io
artifactory-oidc-provider-name:
required: false
description: OIDC provider name
type: string
default: gh-citrusleaf
artifactory-oidc-audience:
required: false
description: OIDC audience
type: string
default: citrusleaf
artifact-name:
description: Name of signed artifacts on github
required: false
type: string
default: signed-artifacts
retention-days:
description: Retention days for the artifacts
required: false
type: number
default: 1
runs-on:
description: The runner to use for the build
required: false
type: string
default: ubuntu-22.04
checkout-path:
description: Directory to checkout the shared-workflows repository into
required: false
type: string
default: shared-workflows
dry-run:
description: Whether to run in dry-run mode. Dry-run mode will not upload any artifacts.
required: false
type: boolean
default: false
outputs:
build-id:
description: The generated build ID
value: ${{ jobs.deploy.outputs.build-id }}
permissions:
contents: read
id-token: write
jobs:
deploy:
runs-on: ${{ inputs.runs-on }}
outputs:
build-id: ${{ steps.deploy.outputs.build-id }}
env:
CHECKOUT_REF: f0466e0e56dade3ffbd1b45491a93e8276abc43c # Latest commit hash for development
steps:
- name: Checkout shared-workflows repository
uses: actions/checkout@v5
with:
repository: aerospike/shared-workflows
ref: ${{ env.CHECKOUT_REF }}
path: ${{ inputs.checkout-path }}
fetch-depth: 1
- name: Setup JFrog CLI
uses: jfrog/setup-jfrog-cli@88e9eba31c07e31beefa4cef5c0e93d1af9535d7 # v4.6.1
env:
JF_URL: ${{ inputs.artifactory-url }}
JF_PROJECT: ${{ inputs.project }}
with:
oidc-provider-name: ${{ inputs.artifactory-oidc-provider-name }}
oidc-audience: ${{ inputs.artifactory-oidc-audience }}
- name: Check JFrog Configuration
run: |
jf c show
jf rt ping
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: ./build-artifacts
- name: Deploy Artifacts
id: deploy
shell: bash
run: |
chmod +x ${{ inputs.checkout-path }}/.github/workflows/deploy-artifacts/entrypoint.sh
dry_run_arg=""
if [ "${{ inputs.dry-run }}" = "true" ]; then
dry_run_arg="--dry-run"
fi
BUILD_ID=$(date +%s%3N) # timestamp in milliseconds (hex)
${{ inputs.checkout-path }}/.github/workflows/deploy-artifacts/entrypoint.sh \
"${{ inputs.project }}" \
"${{ inputs.build-name }}" \
"${{ inputs.version }}" \
"$BUILD_ID" \
$dry_run_arg
echo "build-id=$BUILD_ID" >> $GITHUB_OUTPUT