feat: migrate from circle-ci to github-actions

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
This commit is contained in:
Josh Soref 2021-01-28 18:38:56 -05:00
parent 9e6d1134e8
commit 54d7e73729
3 changed files with 55 additions and 34 deletions

View file

@ -2,40 +2,17 @@ version: 2.1
jobs:
lint:
docker:
- image: quay.io/helmpack/chart-testing:v3.3.1
- image: quay.io/prometheus/busybox
steps:
- checkout
- run: helm repo add stable https://charts.helm.sh/stable
- run: ct lint --config .circleci/chart-testing.yaml --lint-conf .circleci/lintconf.yaml
# Technically this only needs to be run on master, but it's good to have it run on every PR
# so that it is regularly tested.
- run: "true"
publish:
docker:
# We just need an image with `helm` on it. Handily we know of one already.
- image: quay.io/helmpack/chart-testing:v3.3.1
- image: quay.io/prometheus/busybox
steps:
# install the additional keys needed to push to GitHub. Alex Collins owns these keys.
- add_ssh_keys
- run: git config --global user.email "nobody@circleci.com"
- run: git config --global user.name "Circle CI Build"
- checkout
- run: helm repo add stable https://charts.helm.sh/stable
- run: helm repo add minio https://helm.min.io/
- run: helm repo add dandydeveloper https://dandydeveloper.github.io/charts/
# Only actually publish charts on master.
- run: |
set -x
if [ "$CIRCLE_BRANCH" = "master" ]; then
export GIT_PUSH=true
else
export GIT_PUSH=false
fi
sh ./scripts/publish.sh
- run: "true"
workflows:
version: 2
workflow:
jobs:
- lint
- publish:
requires:
- lint
- publish

44
.github/workflows/build-chart.yml vendored Normal file
View file

@ -0,0 +1,44 @@
name: Helm
on:
push:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
container: quay.io/helmpack/chart-testing:v3.3.1
steps:
- uses: actions/checkout@v2
with:
fetch-depth: "0"
- run: helm repo add stable https://charts.helm.sh/stable
- run: ct lint --config .circleci/chart-testing.yaml --lint-conf .circleci/lintconf.yaml
# Technically this only needs to be run on master, but it's good to have it run on every PR
# so that it is regularly tested.
publish:
needs: lint
runs-on: ubuntu-latest
# We just need an image with `helm` on it. Handily we know of one already.
container: quay.io/helmpack/chart-testing:v3.3.1
steps:
- uses: actions/checkout@v2
with:
fetch-depth: "0"
- uses: actions/checkout@v2
with:
ref: gh-pages
path: output
# Only actually publish charts on master.
- name: Publish
run: |
set -x
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --global user.name "$GITHUB_ACTOR"
helm repo add stable https://charts.helm.sh/stable
helm repo add minio https://helm.min.io/
helm repo add dandydeveloper https://dandydeveloper.github.io/charts/
if [ "${GITHUB_REF#refs/heads/}" = "master" ]; then
export GIT_PUSH=true
else
export GIT_PUSH=false
fi
sh ./scripts/publish.sh

View file

@ -4,8 +4,6 @@ set -eux
SRCROOT="$(cd "$(dirname "$0")/.." && pwd)"
GIT_PUSH=${GIT_PUSH:-false}
rm -rf $SRCROOT/output && git clone -b gh-pages git@github.com:argoproj/argo-helm.git $SRCROOT/output
helm repo add argoproj https://argoproj.github.io/argo-helm
for dir in $(find $SRCROOT/charts -mindepth 1 -maxdepth 1 -type d);
@ -31,12 +29,14 @@ do
helm --debug package $dir
done
cp $SRCROOT/*.tgz output/
cd $SRCROOT/output && helm repo index .
cp $SRCROOT/*.tgz $SRCROOT/output/
cd $SRCROOT/output
helm repo index .
cd $SRCROOT/output && git status
git status
git add . && git commit -m "Publish charts"
if [ "$GIT_PUSH" == "true" ]
then
cd $SRCROOT/output && git add . && git commit -m "Publish charts" && git push git@github.com:argoproj/argo-helm.git gh-pages
git push origin gh-pages
fi