Skip to content

Commit

Permalink
Merge pull request #19 from Sabuto/chore/move-to-github-workflow
Browse files Browse the repository at this point in the history
chore: move to GitHub workflow
  • Loading branch information
sabuto authored Feb 5, 2020
2 parents 2d1c116 + 774a871 commit ca6e786
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 49 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Docker build and shellcheck

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: shellcheck
run: shellcheck telegraf/run.sh
- name: build docker files
run: docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v ~/.docker:/root/.docker -v "$(pwd)":/data homeassistant/amd64-builder -t telegraf --all --test
57 changes: 57 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: if release

on:
push:
branches: [master]
tags:
- 0.*

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: shellcheck
run: shellcheck telegraf/run.sh
- name: build docker files
run: docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v ~/.docker:/root/.docker -v "$(pwd)":/data homeassistant/amd64-builder -t telegraf --all --test
- name: deploy docker files
if: github.event_name != 'pull_request'
run: docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /home/travis/.docker:/root/.docker -v "$(pwd)":/data homeassistant/amd64-builder --target telegraf --all --release-tag --docker-user sabuto --docker-password ${{ secrets.DOCKER_PASSWORD }}

push-config-to-main-repo:
needs: build

runs-on: ubuntu-latest

steps:
- name: main
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
path: main
- name: secondary
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
path: secondary
repository: sabuto/hassio-repo-dev

- name: setup local env
run: |
\cp -Rv main/telegraf/config.json secondary/telegraf/config.json
cd secondary
git config --local user.email "[email protected]"
git config --local user.name "sabuto"
git add .
git commit -m "Add changes"
- name: copy config to repo dir in case of change
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_PSA }}
repository: sabuto/hassio-repo-dev
directory: secondary
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

12 changes: 0 additions & 12 deletions build.sh

This file was deleted.

19 changes: 0 additions & 19 deletions dist.sh

This file was deleted.

0 comments on commit ca6e786

Please sign in to comment.