Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add release github workflow #42

Merged
merged 9 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install helm
run: |
sudo apt -y install socat
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash -s -- -v v2.16.7
make helm_install
helm init --wait
- name: Run integration tests
run: make test_integration
33 changes: 33 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
release:
types: [published]
tags:
- v*.*.*

jobs:
test:
name: Publish release
runs-on: ubuntu-latest

env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}

steps:
- name: Checkout commit
uses: actions/checkout@v2
- name: Set env
run: echo ::set-env name=TAG::${GITHUB_REF#refs/tags/v}
- name: Push docker image
run: |
make docker_login
make docker_push
- name: Push helm packages
run: |
make helm_install
helm init --client-only
make helm_plugin_install
make helm_repo_add
make helm_push
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,21 @@ test_integration:
docker_build:
docker build -t $(IMAGE) .

docker_login:
@docker login $(DOCKER_REPO) \
--username=$(ARTIFACTORY_USERNAME) \
--password=$(ARTIFACTORY_PASSWORD)

docker_push: docker_build
ifeq ($(TAG),latest)
$(error Docker image tag is not specified)
endif
docker push $(IMAGE)

helm_install:
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get \
| bash -s -- -v v2.16.7

helm_plugin_install:
helm plugin install https://github.com/belitre/helm-push-artifactory-plugin

Expand All @@ -41,6 +50,10 @@ endif
ifeq ($(ARTIFACTORY_PASSWORD),)
$(error Artifactory password is not specified)
endif
@helm repo add neuro \
https://neuro.jfrog.io/artifactory/helm-virtual-public \
--username ${ARTIFACTORY_USERNAME} \
--password ${ARTIFACTORY_PASSWORD}
@helm repo add neuro-local-public \
https://neuro.jfrog.io/artifactory/helm-local-public \
--username ${ARTIFACTORY_USERNAME} \
Expand Down