8
8
publish_type :
9
9
description : ' Publish Options'
10
10
required : true
11
- default : ' Initial Publish '
11
+ default : ' Initial Release '
12
12
type : choice
13
13
options :
14
- - Initial Publish
14
+ - Initial Release
15
15
- Redeploy
16
16
- Dry Run
17
17
@@ -27,14 +27,14 @@ jobs:
27
27
tag_version : ${{ steps.version.outputs.tag }}
28
28
steps :
29
29
- name : Checkout repo
30
- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
30
+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
31
31
32
32
- name : Branch check
33
- if : ${{ github.event. inputs.publish_type != 'Dry Run' }}
33
+ if : ${{ inputs.publish_type != 'Dry Run' }}
34
34
run : |
35
35
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix-rc-web" ]]; then
36
36
echo "==================================="
37
- echo "[!] Can only release from the 'rc' or 'hotfix-rc-web' branches"
37
+ echo "[!] Can only publish from the 'rc' or 'hotfix-rc-web' branches"
38
38
echo "==================================="
39
39
exit 1
40
40
fi
43
43
id : version
44
44
uses : bitwarden/gh-actions/release-version-check@main
45
45
with :
46
- release-type : ${{ github.event. inputs.publish_type }}
46
+ release-type : ${{ inputs.publish_type }}
47
47
project-type : ts
48
48
file : apps/web/package.json
49
49
monorepo : true
56
56
env :
57
57
_BRANCH_NAME : ${{ github.ref_name }}
58
58
_RELEASE_VERSION : ${{ needs.setup.outputs.release_version }}
59
- _RELEASE_OPTION : ${{ github.event. inputs.publish_type }}
59
+ _RELEASE_OPTION : ${{ inputs.publish_type }}
60
60
steps :
61
61
- name : Print environment
62
62
run : |
67
67
echo "Github Release Option: $_RELEASE_OPTION"
68
68
69
69
- name : Checkout repo
70
- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
70
+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
71
71
72
72
# ######### ACR ##########
73
73
- name : Login to Azure - PROD Subscription
79
79
run : az acr login -n bitwardenprod
80
80
81
81
- name : Create GitHub deployment
82
- if : ${{ github.event. inputs.publish_type != 'Dry Run' }}
82
+ if : ${{ inputs.publish_type != 'Dry Run' }}
83
83
uses : chrnorm/deployment-action@55729fcebec3d284f60f5bcabbd8376437d696b1 # v2.0.7
84
84
id : deployment
85
85
with :
@@ -92,15 +92,15 @@ jobs:
92
92
93
93
- name : Pull branch image
94
94
run : |
95
- if [[ "${{ github.event. inputs.publish_type }}" == "Dry Run" ]]; then
95
+ if [[ "${{ inputs.publish_type }}" == "Dry Run" ]]; then
96
96
docker pull $_AZ_REGISTRY/web:latest
97
97
else
98
98
docker pull $_AZ_REGISTRY/web:$_BRANCH_NAME
99
99
fi
100
100
101
101
- name : Tag version
102
102
run : |
103
- if [[ "${{ github.event. inputs.publish_type }}" == "Dry Run" ]]; then
103
+ if [[ "${{ inputs.publish_type }}" == "Dry Run" ]]; then
104
104
docker tag $_AZ_REGISTRY/web:latest $_AZ_REGISTRY/web:dryrun
105
105
docker tag $_AZ_REGISTRY/web:latest $_AZ_REGISTRY/web-sh:dryrun
106
106
else
@@ -112,7 +112,7 @@ jobs:
112
112
113
113
- name : Push version
114
114
run : |
115
- if [[ "${{ github.event. inputs.publish_type }}" == "Dry Run" ]]; then
115
+ if [[ "${{ inputs.publish_type }}" == "Dry Run" ]]; then
116
116
docker push $_AZ_REGISTRY/web:dryrun
117
117
docker push $_AZ_REGISTRY/web-sh:dryrun
118
118
else
@@ -123,7 +123,7 @@ jobs:
123
123
fi
124
124
125
125
- name : Update deployment status to Success
126
- if : ${{ github.event. inputs.publish_type != 'Dry Run' && success() }}
126
+ if : ${{ inputs.publish_type != 'Dry Run' && success() }}
127
127
uses : chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3
128
128
with :
129
129
token : ' ${{ secrets.GITHUB_TOKEN }}'
@@ -132,7 +132,7 @@ jobs:
132
132
deployment-id : ${{ steps.deployment.outputs.deployment_id }}
133
133
134
134
- name : Update deployment status to Failure
135
- if : ${{ github.event. inputs.publish_type != 'Dry Run' && failure() }}
135
+ if : ${{ inputs.publish_type != 'Dry Run' && failure() }}
136
136
uses : chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3
137
137
with :
138
138
token : ' ${{ secrets.GITHUB_TOKEN }}'
0 commit comments