-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (66 loc) · 2.05 KB
/
instance.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
name: Shopware Instance
on:
workflow_dispatch:
inputs:
id:
description: "Execution ID"
required: true
owner:
description: 'Owner of the repo'
required: true
repo:
description: 'Repo to run against'
required: true
branch:
description: 'Branch to run against'
required: true
default: main
baseRepo:
description: 'baseRepo'
required: true
prNumber:
description: 'PR number'
required: true
permissions:
id-token: write
jobs:
create-instance:
runs-on: ubuntu-latest
steps:
- name: Fetch scoped token
id: fetch-token
uses: FriendsOfShopware/automation-bot/actions/fetch-token@main
with:
id: "${{ inputs.id }}"
- uses: namespacelabs/nscloud-setup@v0
- name: Create a Namespace cluster
id: create-cluster
uses: namespacelabs/nscloud-cluster-action@v0
with:
preview: true
- name: Deploy NGINX
run: |
kubectl run shopware --image=ghcr.io/shopwarelabs/devcontainer/symfony-flex:6.6.8-8.3
kubectl expose pod shopware --type=LoadBalancer --port=8000
- name: Expose application
id: expose
uses: namespacelabs/nscloud-expose-kubernetes-action@v0
with:
instance-id: ${{ steps.create-cluster.outputs.instance-id }}
namespace: default
service: shopware
- name: Wait for Container Startup
run: |
while true; do
kubectl exec shopware -- bin/console plugin:list
if [ $? -eq 0 ]; then
echo "Command succeeded!"
break
fi
echo "Command failed, retrying in 1 seconds..."
sleep 1
done
- name: Fix APP_URL
run: |
kubectl exec pod/shopware -- mariadb -e 'UPDATE sales_channel_domain SET url = "${{ steps.expose.outputs.preview-url }}"'
kubectl exec pod/shopware -- bin/console cache:clear:all