-
Notifications
You must be signed in to change notification settings - Fork 3
36 lines (30 loc) · 1.11 KB
/
wonka.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
name: Remote build
on:
push:
branches: [ main, dev ]
workflow_dispatch:
jobs:
build:
name: Updating deployment manifests
if: ${{ !contains(github.event.head_commit.message, '#k8s') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Update deployments image versions
run: |
git_branch=${GITHUB_REF##*/}
repo=wonka
url=https://${{ secrets.ACTIONS_TOKEN}}@github.com/holaplex/$repo
git_hash=$(git ls-remote $url $git_branch| cut -c1-7)
app=$repo
deployment_file="./$app/app/deployment.yaml"
version=$(cat $deployment_file | grep -i image\: | head -n1 | awk {'print $2'} | cut -d: -f2)
echo "Updating ${app} deployment with new image tag"
sed -i "s/$version/$git_branch-$git_hash/" $deployment_file
- name: Commit and push changes
uses: devops-infra/action-commit-push@master
with:
github_token: ${{ secrets.ACTIONS_TOKEN}}
commit_message: Updated deployment image version