Skip to content

Commit fcb76b1

Browse files
committed
bump
Signed-off-by: NishkarshRaj <[email protected]>
1 parent da18a0e commit fcb76b1

File tree

3 files changed

+96
-46
lines changed

3 files changed

+96
-46
lines changed

docs/2_demo.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,18 @@ $ git log
108108
- [ ] [License](https://opensource.org/licenses/)
109109

110110
- [ ] [GitIgnore](https://github.com/github/gitignore)
111-
111+
112+
- [ ] [Dependabot](https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates)
113+
114+
```yaml
115+
version: 2
116+
updates:
117+
- package-ecosystem: "npm" # See documentation for possible values
118+
directory: "/" # Location of package manifests
119+
schedule:
120+
interval: "weekly"
121+
```
122+
112123
## Contributing to Upstream GitHub Projects
113124
114125
![Upstream](img/Upstream2.png)

docs/3_actions.md

+31-15
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,37 @@ The build and testing of the software is automated and every change or iteration
1818

1919
### A template GitHub Action - Create React App
2020

21-
* `Dockerfile`
22-
23-
```dockerfile
24-
FROM node:14-alpine
25-
WORKDIR /usr/src/app
26-
COPY . .
27-
RUN npm install
28-
EXPOSE 3000
29-
CMD [ "npm", "start" ]
30-
```
31-
32-
- `.dockerignore`
33-
34-
```
35-
node_modules/
21+
```yaml
22+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
23+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
24+
25+
name: Node.js CI
26+
27+
on:
28+
push:
29+
branches: [ "main" ]
30+
pull_request:
31+
branches: [ "main" ]
32+
33+
jobs:
34+
build:
35+
36+
runs-on: ubuntu-latest
37+
38+
strategy:
39+
matrix:
40+
node-version: [14.x, 16.x, 18.x]
41+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
42+
43+
steps:
44+
- uses: actions/checkout@v3
45+
- name: Use Node.js ${{ matrix.node-version }}
46+
uses: actions/setup-node@v3
47+
with:
48+
node-version: ${{ matrix.node-version }}
49+
cache: 'npm'
50+
- run: |
51+
npm install
3652
```
3753
3854
## Important Links and References

docs/4_packages.md

+53-30
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,65 @@
22

33
### Pushing Docker Images on GitHub Packages
44

5-
* Authorize your local machine with the GitHub Package registry
6-
7-
```
8-
$ echo "GitHub Token" | docker login docker.pkg.github.com --username [GitHub Username] --password-stdin
5+
* `Dockerfile`
6+
7+
```dockerfile
8+
FROM node:14-alpine
9+
WORKDIR /usr/src/app
10+
COPY . .
11+
RUN npm install
12+
EXPOSE 3000
13+
CMD [ "npm", "start" ]
914
```
1015

11-
* Tag the local image with the GitHub Repository name
16+
- `.dockerignore`
1217

1318
```
14-
$ docker tag [local image name] docker.pkg.github.com/[GitHub username]/[Repository name]/[Image name]:[Version]
19+
node_modules/
1520
```
1621

17-
* Push the local image to remote GitHub registry
18-
19-
```
20-
$ docker push docker.pkg.github.com/[GitHub username]/[Repository name]/[Image name]:[Version]
21-
```
22-
23-
### Using the Docker Images locally
24-
25-
* Pull the remote docker image locally
26-
27-
```
28-
$ docker pull docker.pkg.github.com/[Username]/[Repository Name]/[Image name]:[version]
29-
```
30-
31-
* Check the Docker Image ID
32-
33-
```
34-
$ docker images
35-
```
36-
37-
* Launch a docker container using the pulled docker image
38-
39-
```
40-
$ docker run -it [Image ID]
22+
- `Docker Build And Push Actions`
23+
24+
```yaml
25+
name: Create and publish a Docker image
26+
27+
on: push
28+
29+
env:
30+
REGISTRY: ghcr.io
31+
IMAGE_NAME: ${{ github.repository }}
32+
33+
jobs:
34+
build-and-push-image:
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: read
38+
packages: write
39+
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v3
43+
44+
- name: Log in to the Container registry
45+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
46+
with:
47+
registry: ${{ env.REGISTRY }}
48+
username: ${{ github.actor }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Extract metadata (tags, labels) for Docker
52+
id: meta
53+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
54+
with:
55+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
56+
57+
- name: Build and push Docker image
58+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
59+
with:
60+
context: .
61+
push: true
62+
tags: ${{ steps.meta.outputs.tags }}
63+
labels: ${{ steps.meta.outputs.labels }}
4164
```
4265
4366
## Important Links and References

0 commit comments

Comments
 (0)