From 8c08fcd4ca153d9503793ec47044ce94ae5ba763 Mon Sep 17 00:00:00 2001 From: dcarrillo Date: Sun, 15 Dec 2019 17:54:03 +0100 Subject: [PATCH] Add github workflow for CI --- .github/main.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/main.yml diff --git a/.github/main.yml b/.github/main.yml new file mode 100644 index 0000000..74ffc85 --- /dev/null +++ b/.github/main.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +jobs: + tests: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + + steps: + - uses: actions/checkout@v1 + + - name: Build image + run: ./build.sh + + - name: Run tests + run: ./tests/test.sh + + deploy: + runs-on: ubuntu-latest + if: github.event_name == 'push' + + steps: + - uses: actions/checkout@v1 + + - name: Log in to dockerhub + run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin + + - name: Deploy image + run: ./build.sh --push --latest