Skip to content

Commit

Permalink
add release github workflow (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Zubenko authored Jun 18, 2020
1 parent 59ee0bb commit f7a3ac6
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
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

0 comments on commit f7a3ac6

Please sign in to comment.