feat: migrate from circle-ci to github-actions
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
This commit is contained in:
parent
9e6d1134e8
commit
54d7e73729
3 changed files with 55 additions and 34 deletions
|
@ -2,40 +2,17 @@ version: 2.1
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
docker:
|
docker:
|
||||||
- image: quay.io/helmpack/chart-testing:v3.3.1
|
- image: quay.io/prometheus/busybox
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- run: "true"
|
||||||
- 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:
|
publish:
|
||||||
docker:
|
docker:
|
||||||
# We just need an image with `helm` on it. Handily we know of one already.
|
- image: quay.io/prometheus/busybox
|
||||||
- image: quay.io/helmpack/chart-testing:v3.3.1
|
|
||||||
steps:
|
steps:
|
||||||
# install the additional keys needed to push to GitHub. Alex Collins owns these keys.
|
- run: "true"
|
||||||
- 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
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
workflow:
|
workflow:
|
||||||
jobs:
|
jobs:
|
||||||
- lint
|
- lint
|
||||||
- publish:
|
- publish
|
||||||
requires:
|
|
||||||
- lint
|
|
||||||
|
|
44
.github/workflows/build-chart.yml
vendored
Normal file
44
.github/workflows/build-chart.yml
vendored
Normal 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
|
|
@ -4,8 +4,6 @@ set -eux
|
||||||
SRCROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
SRCROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
GIT_PUSH=${GIT_PUSH:-false}
|
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
|
helm repo add argoproj https://argoproj.github.io/argo-helm
|
||||||
|
|
||||||
for dir in $(find $SRCROOT/charts -mindepth 1 -maxdepth 1 -type d);
|
for dir in $(find $SRCROOT/charts -mindepth 1 -maxdepth 1 -type d);
|
||||||
|
@ -31,12 +29,14 @@ do
|
||||||
helm --debug package $dir
|
helm --debug package $dir
|
||||||
done
|
done
|
||||||
|
|
||||||
cp $SRCROOT/*.tgz output/
|
cp $SRCROOT/*.tgz $SRCROOT/output/
|
||||||
cd $SRCROOT/output && helm repo index .
|
cd $SRCROOT/output
|
||||||
|
helm repo index .
|
||||||
|
|
||||||
cd $SRCROOT/output && git status
|
git status
|
||||||
|
git add . && git commit -m "Publish charts"
|
||||||
|
|
||||||
if [ "$GIT_PUSH" == "true" ]
|
if [ "$GIT_PUSH" == "true" ]
|
||||||
then
|
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
|
fi
|
||||||
|
|
Loading…
Reference in a new issue