-
Notifications
You must be signed in to change notification settings - Fork 26
51 lines (48 loc) · 1.96 KB
/
4testing_repo.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
---
name: Build 4testing repo
on:
workflow_dispatch:
jobs:
build:
name: Chart release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set chart version
run: |
wget https://download.onlyoffice.com/charts/4testing/index.yaml -P /tmp
LATEST_VERSION=$(awk '/docs:/{f=1};f{print}' /tmp/index.yaml | awk '/version:/ {print $2;}' | head -1)
NEW_VERSION=$(awk '/version:/ {print $2;}' Chart.yaml)
if [[ "$LATEST_VERSION" == *"$NEW_VERSION"* ]]; then
RC=${LATEST_VERSION: -1}
let "RC+=1"
else
RC='1'
fi
NEW_VERSION=$(echo $NEW_VERSION)-rc$RC
sed 's/\(version:\).*/\1 '$NEW_VERSION'/' -i Chart.yaml
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET }}
aws-region: us-east-1
- name: Helm release
uses: shellbear/[email protected]
with:
repo: ${{ secrets.AWS_BUCKET_URL }}/charts/4testing
chart: ./
- name: Reindex index.yaml
run: |
aws s3 cp ${{ secrets.AWS_BUCKET_URL }}/charts/4testing/index.yaml .
ls | grep index.yaml
sed -i "s|${{ secrets.AWS_BUCKET_URL }}|${{ secrets.AWS_CLOUDFRONT_URL }}|g" index.yaml
aws s3 cp index.yaml ${{ secrets.AWS_BUCKET_URL }}/charts/4testing/ --acl public-read
- name: Make public access to chart repo
run: |
mkdir s3dir
aws s3 cp ${{ secrets.AWS_BUCKET_URL }}/charts/4testing/ ./s3dir --recursive
aws s3 cp ./s3dir ${{ secrets.AWS_BUCKET_URL }}/charts/4testing --acl public-read --recursive
- name: Invalidate CLOUDFRONT cache
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths "/charts/4testing/*"