Replace master workflow with ci workflow, build and docker for v tags

This commit is contained in:
simojenki
2021-08-24 08:36:18 +10:00
parent 77fab65d82
commit 75d8c576c3
2 changed files with 19 additions and 28 deletions

View File

@@ -1,25 +1,33 @@
name: Build name: ci
on: on:
push: push:
branches: [ master ] branches:
# pull_request: - 'master'
# branches: [ master ] tags:
- 'v*'
pull_request:
branches:
- 'master'
jobs: jobs:
build_and_test: build_and_test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 -
- uses: actions/setup-node@v1 uses: actions/checkout@v2
-
uses: actions/setup-node@v1
with: with:
node-version: 14.x node-version: 16.x
- run: yarn install -
- run: yarn test run: yarn install
-
run: yarn test
push_to_registry: push_to_registry:
needs: build_and_test
name: Push Docker image to Docker Hub name: Push Docker image to Docker Hub
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -46,5 +54,4 @@ jobs:
context: . context: .
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: latest labels: ${{ steps.meta.outputs.labels }}

View File

@@ -1,16 +0,0 @@
name: Test PR
on: pull_request
jobs:
build_and_test:
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
- run: docker build