-
Notifications
You must be signed in to change notification settings - Fork 456
77 lines (76 loc) · 2.48 KB
/
deploy-docker-image-vue-storefront-cloud.yml
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
name: Deploy docker image to storefront cloud
on:
workflow_call:
inputs:
ENVIRONMENT:
required: true
type: string
TARGET_URL:
required: true
type: string
FARMER_NAMESPACE_NAME:
required: true
type: string
DOCS_NAME:
required: true
type: string
DOCS_IMAGE:
required: true
type: string
DOCS_SUBPATH:
required: true
type: string
DOCS_PORT:
required: true
type: string
HAS_BASE_PATH:
required: false
type: string
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.ENVIRONMENT }}
permissions:
deployments: write
steps:
- uses: chrnorm/deployment-action@releases/v1
name: Create GitHub deployment
id: deployment
with:
token: ${{ github.token }}
target_url: ${{ inputs.TARGET_URL }}
environment: ${{ inputs.ENVIRONMENT }}
initial_status: in_progress
- name: Deploy on ${{ inputs.TARGET_URL }}
id: publish
# Not using the vuestorefront/* package because of:
# https://github.com/vuestorefront/publish-docs-action/compare/main...Mateuszpietrusinski:publish-docs-action:main
uses: Mateuszpietrusinski/[email protected]
with:
user-id: ${{ secrets.CLOUD_USERNAME }}
api-key: ${{ secrets.CLOUD_PASSWORD }}
name: ${{ inputs.DOCS_NAME }}
tag: ${{ github.sha }}
image: ${{ inputs.DOCS_IMAGE }}
path: ${{ inputs.DOCS_SUBPATH }}
port: ${{ inputs.DOCS_PORT}}
has-base-path: ${{ inputs.HAS_BASE_PATH}}
farmer-namespace-name: ${{ inputs.FARMER_NAMESPACE_NAME }}
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
with:
token: ${{ github.token }}
target_url: ${{ inputs.TARGET_URL }}
state: "success"
description: Congratulations! The deploy is done.
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@releases/v1
with:
token: ${{ github.token }}
target_url: ${{ inputs.TARGET_URL }}
description: Unfortunately, the instance hasn't been updated.
state: "failure"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}