-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (62 loc) · 2.35 KB
/
prod-deploy.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
name: Docker Image CI for shopify-tracker
on:
push:
branches: [ main ]
pull_request:
types:
- closed
branches:
- main
permissions: read-all
jobs:
build:
name: Build image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Get image version
id: get-version
run: |
VERSION=$(jq -r .version package.json)
echo "Version: $VERSION"
echo "::set-output name=version::$VERSION"
- name: Build Shopify Tracker Docker Image
# Only merged pull requests must trigger
if: github.event.pull_request.merged == true
uses: ./.github/workflows/build-and-push-docker-image.yml
with:
img_tag: rudder-shopify-tracker:${{steps.get-version.outputs.version}}
- name: Extract branch name
id: extract_branch_name
run: |
branch_name=$(git rev-parse --abbrev-ref HEAD)
echo "branch_name=$branch_name"
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT
- name: Initialize Mandatory Git Config
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "noreply@github.com"
- name: Clone Devops Repo
run: |
git clone https://${{secrets.PAT}}@github.com/rudderlabs/rudder-devops.git
- name: Update Helm Chart and Raise Pull Request For Shopify Tracker
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
SP_IMAGE_REPOSITORY: rudderstack/rudder-shopify-tracker
VERSION: ${{steps.get-version.outputs.version}}
run: |
cd rudder-devops
git checkout -b shopify-tracker-$VERSION ${{steps.extract_branch_name.outputs.branch_name}}
cd helm-charts/helm/shopify-tracking
yq eval -i ".image.tag=\"$VERSION\"" values.yaml
yq eval -i ".image.repository=\"$SP_IMAGE_REPOSITORY\"" values.yaml
git add values.yaml
git commit -m "chore: upgrade shopify tracker to $VERSION"
git push -u origin shopify-tracker-$VERSION
hub pull-request -m "chore: upgrade shopify tracker to $VERSION"