-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (59 loc) · 2.53 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# 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
# this is to describe what workflow is doing
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# above are the events that are mentioned .. any times event happens we can trigger a workflow
# below is the workflow that will be triggered on event trigger
jobs:
build:
# name of the job .. can be anything .. it groups set of actions
runs-on: ubuntu-latest
# ${{matrix.os}}
strategy:
matrix:
# os: [ubuntu-latest, windows-latest, macOS-latest]
node-version: [15.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
# this is the place where precreated or predefined actions are hosted/written
# this checkout is for .. we ned to checkout the repo/project .. they have written the script .. we just need to
# all actions are repos .. this is the version of release .. some community release some
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
# this is used for installing dependencies OR dev dependencies from a package-lock.json file
# dev dependencies are modules which are only required during development,
# dependencies are modules which are also required at runtime
- run: npm run build --if-present
# build the app for production to the build folder. It correctly bundles React in production mode and optimises the build for best perfomances
- run: npm 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: rohityawalkar04/my-repo
tag_with_ref: true
# - name: Build and Push Docker Image
# uses: mr-smithers-excellent/docker-build-push@v4
# with:
# image: react-project:1.0
# registry: docker.io
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# # uses:
# # with: