-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from f41gh7/master
Adds github actions
- Loading branch information
Showing
4 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: publish latest | ||
# This workflow will run on master branch | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
jobs: | ||
build: | ||
name: build | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: Inject slug/short variables | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Code checkout | ||
uses: actions/checkout@master | ||
|
||
- name: build and push to remote registry | ||
env: | ||
TAG: ${{ env.GITHUB_REF_SLUG }} | ||
run: | | ||
echo ${{secrets.REPO_KEY}} | docker login --username ${{secrets.REPO_USER}} --password-stdin | ||
make latest-push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Release | ||
on: | ||
release: | ||
types: | ||
- created | ||
jobs: | ||
release: | ||
name: Release on GitHub | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: Inject slug/short variables | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: build and push to remote registry | ||
env: | ||
TAG: ${{ env.GITHUB_REF_SLUG }} | ||
run: | | ||
echo ${{secrets.REPO_KEY}} | docker login --username ${{secrets.REPO_USER}} --password-stdin | ||
make release-push | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
ui-web-amd64.zip | ||
ui-web-windows.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
REPO=victoriametrics/ui | ||
|
||
BUILDINFO_TAG ?= $(shell echo $$(git describe --long --all | tr '/' '-')$$( \ | ||
git diff-index --quiet HEAD -- || echo '-dirty-'$$(git diff-index -u HEAD | openssl sha1 | cut -c 10-17))) | ||
|
||
PKG_TAG ?= $(shell git tag -l --points-at HEAD) | ||
ifeq ($(PKG_TAG),) | ||
PKG_TAG := $(BUILDINFO_TAG) | ||
endif | ||
|
||
|
||
package-via-docker: | ||
cd packages/victoria-metrics-ui &&\ | ||
docker build -t ${REPO}:latest -f Dockerfile-web . | ||
|
||
release-via-docker: package-via-docker | ||
echo ${PKG_TAG} | ||
docker tag ${REPO}:latest ${REPO}:${PKG_TAG} | ||
docker rm ui-build-${PKG_TAG} 2>> /dev/null || true | ||
docker create --name ui-build-${PKG_TAG} ${REPO}:${PKG_TAG} | ||
docker cp ui-build-${PKG_TAG}:/app/web $(shell pwd)/ui-web-amd64 | ||
docker cp ui-build-${PKG_TAG}:/app/web-windows $(shell pwd)/ui-web-windows | ||
zip -r ui-web-amd64.zip ui-web-amd64 | ||
zip -r ui-web-windows.zip ui-web-windows | ||
docker rm ui-build-${PKG_TAG} | ||
|
||
latest-push: package-via-docker | ||
docker push ${REPO} | ||
|
||
release-push: release-via-docker | ||
docker push ${REPO}:${PKG_TAG} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters