-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample-workflow.yml
More file actions
75 lines (68 loc) · 3.08 KB
/
Copy pathexample-workflow.yml
File metadata and controls
75 lines (68 loc) · 3.08 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
name: Example Quant Cloud Deployment (Simplified!)
on:
push:
branches: [main, develop, feature/*]
tags: ['*']
pull_request:
branches: [main, develop]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Initialize Quant Cloud (includes Docker login!)
uses: your-org/quant-cloud-init-action@v1
id: init
with:
quant_organization: ${{ secrets.QUANT_ORGANIZATION }}
quant_api_key: ${{ secrets.QUANT_API_KEY }}
# Optional overrides:
# quant_application: my-custom-app
# master_branch_override: main
# environment_name_override: staging
# No Docker login step needed - it's handled automatically!
# Build and push images with automatic tag suffixes
# - main/master branches: -latest
# - develop branch: -develop
# - feature branches: -{branch-name} (e.g., -feature-my-big-feature)
# - tags: -{tag-name} (e.g., -v1.0.0)
- name: Build and push CLI image
uses: docker/build-push-action@v5
with:
context: .
file: ./.docker/Dockerfile.cli
platforms: linux/arm64
push: true
tags: ${{ steps.init.outputs.stripped_endpoint }}/${{ secrets.QUANT_ORGANIZATION }}/${{ steps.init.outputs.quant_application }}:cli${{ steps.init.outputs.image_suffix }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push PHP image
uses: docker/build-push-action@v5
with:
context: .
file: ./.docker/Dockerfile.php
platforms: linux/arm64
push: true
tags: ${{ steps.init.outputs.stripped_endpoint }}/${{ secrets.QUANT_ORGANIZATION }}/${{ steps.init.outputs.quant_application }}:php${{ steps.init.outputs.image_suffix }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Redeploy environment (if not feature branch)
if: steps.init.outputs.environment_name != 'feature'
uses: quantcdn/quant-cloud-environment-state-action@v1
with:
api_key: ${{ secrets.QUANT_API_KEY }}
organization: ${{ secrets.QUANT_ORGANIZATION }}
application: ${{ steps.init.outputs.quant_application }}
environment: ${{ steps.init.outputs.environment_name }}
action: redeploy
- name: Show deployment summary
run: |
echo "🎉 Deployment completed successfully!"
echo "Application: ${{ steps.init.outputs.quant_application }}"
echo "Environment: ${{ steps.init.outputs.environment_name }}"
echo "Production: ${{ steps.init.outputs.is_production }}"
echo "Registry Endpoint: ${{ steps.init.outputs.stripped_endpoint }}"
echo "Image Suffix: ${{ steps.init.outputs.image_suffix }}"
echo "✅ Docker was automatically logged in during initialization!"
echo "🎯 Images will be tagged with: ${{ steps.init.outputs.quant_application }}${{ steps.init.outputs.image_suffix }}"