Skip to content

Commit

Permalink
Merge pull request #92 from vania-pooh/master
Browse files Browse the repository at this point in the history
Migrated to Github Actions
  • Loading branch information
vania-pooh authored Jan 19, 2022
2 parents ba0a31b + c72fddb commit 8f39bc6
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 65 deletions.
60 changes: 0 additions & 60 deletions .drone.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: build

on:
push:
branches:
- master

jobs:
build-chart:
runs-on: ubuntu-latest
if: github.repository == 'aerokube/charts'
steps:
- uses: actions/checkout@v2

- name: Test
run: ci/test.sh

- name: Build
run: |
git fetch --tags
export VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))-$(git rev-parse --short HEAD)
ci/build.sh $VERSION unstable
- name: Configure S3 credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.S3_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.S3_SECRET_KEY }}
aws-region: ${{ secrets.S3_REGION }}

- name: Send output to S3 bucket
working-directory: ./output
run: aws s3 cp . --endpoint=${{ secrets.S3_ENDPOINT }} s3://${{ secrets.S3_BUCKET_NAME }} --recursive --acl public-read
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: release

on:
release:
types: [published]

jobs:
release-chart:
runs-on: ubuntu-latest
if: github.repository == 'aerokube/charts'
steps:
- uses: actions/checkout@v2

- name: Test
run: ci/test.sh

- name: Prepare release version
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV

- name: Build
run: ci/build.sh $RELEASE_VERSION

- name: Configure S3 credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.S3_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.S3_SECRET_KEY }}
aws-region: ${{ secrets.S3_REGION }}

- name: Send output to S3 bucket
working-directory: ./output
run: aws s3 cp . --endpoint=${{ secrets.S3_ENDPOINT }} s3://${{ secrets.S3_BUCKET_NAME }} --recursive --acl public-read
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: test

on:
pull_request:

jobs:
test-chart:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Test
run: ci/test.sh
12 changes: 7 additions & 5 deletions ci/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

set -e

CHARTS_REPO="https://charts.aerokube.com/"

version=$1
Expand All @@ -9,8 +11,8 @@ if [ -n "$path" ]; then
output_dir="$output_dir/$path"
CHARTS_REPO="$CHARTS_REPO$path/"
fi
mkdir -p ${output_dir}
helm package moon --destination ${output_dir} --version ${version}
cd ${output_dir}
wget ${CHARTS_REPO}/index.yaml || true
helm repo index . --url ${CHARTS_REPO} --merge index.yaml
mkdir -p "$output_dir"
helm package moon --destination "$output_dir" --version "$version"
cd "$output_dir"
wget "$CHARTS_REPO/index.yaml" || true
helm repo index . --url "$CHARTS_REPO" --merge index.yaml

0 comments on commit 8f39bc6

Please sign in to comment.