Skip to content

Commit 44823f9

Browse files
committed
pushing Dockerfile and github workflow files
0 parents  commit 44823f9

File tree

4 files changed

+161
-0
lines changed

4 files changed

+161
-0
lines changed

.github/workflows/main.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: build on change
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
workflow_dispatch:
9+
repository_dispatch:
10+
types: epaath
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
arch: [amd64, arm, arm64]
19+
20+
steps:
21+
- name: Login to Docker
22+
run: |
23+
echo ${{ secrets.DOCKER_PASSWORD }} | docker login docker.io -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
24+
# echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
25+
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v1
31+
32+
- name: Build and push Docker image
33+
env:
34+
GITLAB_USERNAME: ${{ secrets.GITLAB_USERNAME }}
35+
GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
36+
run: |
37+
export DOCKER_CLI_EXPERIMENTAL=enabled
38+
base="treehouses/nginx-tags:${{ matrix.arch }}"
39+
repo="rayheyehygun/epaath"
40+
dest="$repo:${{ matrix.arch }}"
41+
date="$(date +%Y%m%d%H%M)"
42+
echo a
43+
docker build -t $dest --build-arg BASE=$base ./
44+
echo 0
45+
# docker tag $dest ghcr.io/$dest
46+
docker tag $dest docker.io/$dest
47+
echo 1 $dest
48+
docker tag $dest $dest-$date
49+
echo 2 $repo
50+
docker images
51+
# docker push --all-tags ghcr.io/$repo
52+
docker push --all-tags docker.io/$repo
53+
54+
# notify:
55+
# needs: build-and-push
56+
# runs-on: ubuntu-latest
57+
# if: always()
58+
# steps:
59+
# - name: Notify about new Docker images
60+
# env:
61+
# DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
62+
# run: |
63+
# curl -H "Content-Type: application/json" \
64+
# -X POST \
65+
# -d '{"Epaath": "New Docker images have been built and pushed successfully."}' \
66+
# $DISCORD_WEBHOOK_URL

.gitignore

Whitespace-only changes.

Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM treehouses/nginx:1.18
2+
3+
RUN apk --no-cache upgrade
4+
RUN apk add --no-cache curl git
5+
6+
WORKDIR /var/lib/nginx
7+
8+
RUN rm -rf html
9+
# COPY ./epaath_es_oneactivity_project /var/lib/nginx/html
10+
RUN git clone --depth=1 --single-branch --branch with_all_activities https://GITLAB_USERNAME:[email protected]/regan/epaath_es_oneactivity_project.git html
11+
# RUN mv -f musicblocks html
12+
# COPY . html
13+
14+
EXPOSE 80 443 3000
15+
16+
CMD ["nginx", "-g", "daemon off;"]

README.md

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
2+
## Overview
3+
4+
This GitHub project automates the building and pushing of Docker images containing the `epaath` project cloned from a GitLab repository. It utilizes GitHub Actions for CI/CD processes, ensuring that the latest version of `epaath` is always packaged within the Docker images, ready for deployment.
5+
6+
## GitHub Workflow
7+
8+
The `.github/workflows/build-on-change.yml` workflow triggers on pushes to the `master` and `main` branches, as well as on `workflow_dispatch` and `repository_dispatch` events specifically for `epaath`. It builds Docker images for `amd64`, `arm`, and `arm64` architectures, then pushes them to Docker Hub under the repository `rayheyehygun/epaath`.
9+
10+
## Dockerfile
11+
12+
The `Dockerfile` in the root directory specifies the environment for running the `epaath` project. It is based on `treehouses/nginx:1.18`, with the `epaath` project cloned directly into the nginx serving directory.
13+
14+
## Prerequisites
15+
16+
To use this workflow and Dockerfile, ensure you have the following:
17+
18+
- Docker installed and running on your machine.
19+
- A GitHub account with access to this repository.
20+
- A Docker Hub account for pushing the images.
21+
- A GitLab account with access to the `epaath_es_oneactivity_project` repository.
22+
23+
## Setup
24+
25+
1. **GitHub Secrets**: Configure the following secrets in your GitHub repository settings:
26+
- `DOCKER_USERNAME` and `DOCKER_PASSWORD`: Credentials for Docker Hub.
27+
- `GITLAB_USERNAME` and `GITLAB_PASSWORD`: Credentials for GitLab.
28+
29+
2. **Running the Workflow**: Trigger the workflow by pushing changes to the `master` or `main` branches, or manually via the GitHub Actions tab.
30+
31+
## Usage
32+
33+
After the workflow successfully pushes a Docker image, you can pull the image using:
34+
35+
```bash
36+
docker pull rayheyehygun/epaath:<architecture>-<timestamp>
37+
```
38+
39+
Replace `<architecture>` with `amd64`, `arm`, or `arm64` and `<timestamp>` with the build timestamp.
40+
41+
To run the Docker container:
42+
43+
```bash
44+
docker run -d -p 80:80 rayheyehygun/epaath:<tag>
45+
```
46+
47+
This will start a container with `epaath` running on port 80.
48+
49+
## Contributing
50+
51+
Contributions to the project are welcome! Please follow standard GitHub pull request procedures to submit your changes.
52+
53+
## License
54+
55+
Specify your project's license here.
56+
57+
58+
# About E-Paath
59+
60+
E-Paath is a free learning platform created by OLE Nepal with over 400 interactive learning modules that are designed to align with Nepal's national curriculum. Catering to specific subjects and grade levels from 1 to 8, E-Paath modules are available in Nepali and English languages, and adaptable to any. E-Paath also offers instruction in Nepali Sign Language (NSL) for grades 1 to 6. E-Paath is accessible through any web browser, on mobile and tablets, and can be utilized online via OLE Nepal's digital library, E-Pustakalaya.
61+
62+
## Key Features
63+
64+
- **Engaging and Meaningful**: Designed for interactive and contextual learning experiences.
65+
- **Curriculum Aligned**: Complements national curriculum for learning objectives.
66+
- **Multimedia Based**: Uses contextualized images, audio, animations, games.
67+
- **400+ Modular Activities**: Each module corresponds to a subject and a grade.
68+
- **Grades Covered**: One - Eight
69+
- **Subjects Covered**: Math, Science, English, and Nepali (Grades 1-4)
70+
- **Multilingual Support**: In Nepali and English, Chepang (Grades 2-6), and NSL (Grades 1-6).
71+
- **Activity Guide**: Modules include activity guide for teachers and guardians.
72+
73+
## How is E-Paath Developed?
74+
75+
A team of curriculum experts, graphic designers, software developers and translators work together to create E-Paath activities. From conceptualization to design and development, the team pays close attention to ensure that the activities meet the learning objectives, are fun and interactive, and the graphic elements, text and audio components are contextualized to match students' diverse local environments.
76+
77+
## What is our approach for E-Paath Development?
78+
79+
E-Paath design and development is based on a student-centered learning approach. The learning content is situated in real world scenarios and local context so that learning is personally meaningful to the students. We provide timely assessment so that the students can learn in a practice-based approach at their own pace. Along with giving fun and engaging learning experiences to the students, we also aim to promote a positive attitude to learning and positive self-esteem as a learner.

0 commit comments

Comments
 (0)