From 5ff6f133b389fd9bb82f83591641db28929b1096 Mon Sep 17 00:00:00 2001 From: simojenki Date: Fri, 29 Jan 2021 13:13:19 +1100 Subject: [PATCH] autopublish docker image on commit --- .github/workflows/cicd.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 29 ----------------------------- 2 files changed, 33 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/cicd.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml new file mode 100644 index 0000000..1f81bb6 --- /dev/null +++ b/.github/workflows/cicd.yml @@ -0,0 +1,33 @@ +name: CI/CD + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 14.x + - run: yarn install + - run: yarn test + + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Push to Docker Hub + uses: docker/build-push-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: simojenki/bonob + tag_with_ref: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 0564772..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,29 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Node.js CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [14.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: yarn install - - run: yarn test