This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 84
81 lines (79 loc) · 2.91 KB
/
docs-deployment.yaml
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
name: Deploy Documentation
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- shell: bash
run: |
echo "1.0.`date +%s`" > version.txt
- name: Upload version artifact
uses: actions/upload-artifact@v2
with:
name: version
path: version.txt
- name: Get the version
id: get_version
run: echo "VERSION=$(cat version.txt)" >> $GITHUB_OUTPUT
- name: Build and publish docker image
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: docs-storefrontcloud-io/v2-shopify:${{ steps.get_version.outputs.VERSION }}
registry: registry.storefrontcloud.io
username: ${{ secrets.DOCS_CLOUD_USERNAME }}
password: ${{ secrets.DOCS_CLOUD_PASSWORD }}
workdir: .
dockerfile: ./.vuestorefrontcloud/docker/docs/Dockerfile
buildoptions: "--compress"
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download version artifact
uses: actions/download-artifact@v2
with:
name: version
- name: Get the version
id: get_version
run: echo "VERSION=$(cat version.txt)" >> $GITHUB_OUTPUT
- uses: chrnorm/deployment-action@releases/v1
name: Create GitHub deployment
id: deployment
with:
token: "${{ github.token }}"
target_url: https://docs.europe-west1.gcp.storefrontcloud.io/shopify
environment: production
initial_status: in_progress
- name: Deploy on docs.europe-west1.gcp.storefrontcloud.io/shopify
id: publish
uses: vuestorefront/publish-docs-action@main
with:
user-id: ${{ secrets.DOCS_CLOUD_USERNAME }}
api-key: ${{ secrets.DOCS_CLOUD_PASSWORD }}
name: "docs-v2-shopify"
tag: "${{ steps.get_version.outputs.VERSION }}"
image: "registry.storefrontcloud.io/docs-storefrontcloud-io/v2-shopify"
path: "/shopify"
port: "80"
has-base-path: true
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
with:
token: "${{ github.token }}"
target_url: https://docs.europe-west1.gcp.storefrontcloud.io/shopify
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: https://docs.europe-west1.gcp.storefrontcloud.io/shopify
description: Unfortunately, the instance hasn't been updated.
state: "failure"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}