forked from SakshamHaryana-SE/enketo
-
Notifications
You must be signed in to change notification settings - Fork 28
feat(docker): added workflows for building and pushing docker images #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Ansh-Sarkar
wants to merge
44
commits into
Samagra-Development:main
Choose a base branch
from
Ansh-Sarkar:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
2e038dc
test: checking workflow trigger
Ansh-Sarkar 9e6bdbb
Merge branch 'Samagra-Development:main' into main
Ansh-Sarkar 7ed5281
feat(workflows): added docker build and push workflow
Ansh-Sarkar a1d5fd0
fix(workflows): build docs only on change
Ansh-Sarkar 532e344
test(workflows): testing docker image build
Ansh-Sarkar 66ba8ca
test(workflows): testing docker image build
Ansh-Sarkar fd23907
test(workflows): testing docker image build
Ansh-Sarkar 270367e
Added
Ansh-Sarkar 20d6b12
test
Ansh-Sarkar 524523b
Added
Ansh-Sarkar 796bd91
Added
Ansh-Sarkar 4976f4a
Added
Ansh-Sarkar c918079
Added
Ansh-Sarkar e34104f
Added
Ansh-Sarkar ad6d8fe
Added
Ansh-Sarkar f15f4db
Added:
Ansh-Sarkar 09ae9cc
added
Ansh-Sarkar 2b8b56e
Added
Ansh-Sarkar d663af1
Added
Ansh-Sarkar af53436
Added
Ansh-Sarkar 901c597
addded
Ansh-Sarkar 33665fb
Added
Ansh-Sarkar 5845af5
added
Ansh-Sarkar 864efa7
feat(workflows): added workflow for form-manager package
Ansh-Sarkar eadb0fa
fix(workflows): removed run cmd
Ansh-Sarkar 5b76196
test
Ansh-Sarkar 28cf94a
fix(workflows): generalized github actors and workflow file
Ansh-Sarkar 21f9215
fix(workflows): fixed lowecase issue for ghcr
Ansh-Sarkar c936fc4
added
Ansh-Sarkar 846e920
Added
Ansh-Sarkar a674e64
Added
Ansh-Sarkar 46af1f3
added
Ansh-Sarkar 2b6b2c7
added
Ansh-Sarkar f68ebfb
checking workflow
Ansh-Sarkar 1edc883
added
Ansh-Sarkar 6c9bd81
Added
Ansh-Sarkar 5b543e4
fix(workflows): fixed minor issues
Ansh-Sarkar 9b5d9f3
fix(workflows): fixed minor naming issues
Ansh-Sarkar 7a849a1
fix(workflows): reorder PR checks for triggering workflows
Ansh-Sarkar 745af07
fix(config file): fix config file
Ansh-Sarkar e3c2988
test
Ansh-Sarkar 88df3e2
Added
Ansh-Sarkar db76e69
fix(docs & docker): fixed readme and commented out sha files from docker
Ansh-Sarkar 38dc639
test(workflows): removed overriding image build
Ansh-Sarkar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# name: publish | ||
# on: | ||
# push: | ||
# paths: | ||
# - packages/enketo-express/** | ||
# branches: [main] | ||
# jobs: | ||
# publish-hello-docker-image: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: Login to GitHub Container Registry | ||
# uses: docker/login-action@v1 | ||
# with: | ||
# registry: ghcr.io | ||
# username: ${{ github.actor }} | ||
# password: ${{ secrets.GITHUB_TOKEN }} | ||
# - name: Build the hello-docker Docker image | ||
# run: | | ||
# cd packages/enketo-express | ||
# docker build . --tag ghcr.io/ansh-sarkar/enketo-express:latest | ||
# docker run ghcr.io/ansh-sarkar/enketo-express:latest | ||
# docker push ghcr.io/ansh-sarkar/enketo-express:latest |
29 changes: 29 additions & 0 deletions
29
.github/workflows/enketo-express-docker-build-push-ghcr.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Enketo Express Publish | ||
on: | ||
push: | ||
paths: | ||
- packages/enketo-express/** | ||
tags: | ||
- '*' | ||
branches: [main] | ||
jobs: | ||
publish-enketo-express-docker-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: set lower case owner name | ||
run: | | ||
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV} | ||
env: | ||
OWNER: '${{ github.repository_owner }}' | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build enketo-express Docker image | ||
run: | | ||
cd packages/enketo-express | ||
docker build . --tag ghcr.io/$OWNER_LC/enketo-express:latest | ||
docker push ghcr.io/$OWNER_LC/enketo-express:latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Form Manager Publish | ||
on: | ||
push: | ||
paths: | ||
- packages/form-manager/** | ||
tags: | ||
- '*' | ||
branches: [main] | ||
jobs: | ||
publish-form-manager-docker-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: set lower case owner name | ||
run: | | ||
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV} | ||
env: | ||
OWNER: '${{ github.repository_owner }}' | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build form-manager Docker image | ||
run: | | ||
cd packages/form-manager | ||
docker build . --tag ghcr.io/$OWNER_LC/form-manager:latest | ||
docker push ghcr.io/$OWNER_LC/form-manager:latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the Commented lines are not useful in the future it's better to remove them isn't it? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Base image | ||
FROM node:14 | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
|
||
# A wildcard is used to ensure both package.json AND package-lock.json are copied | ||
COPY package*.json ./ | ||
|
||
# Install app dependencies | ||
RUN npm install | ||
|
||
# Bundle app source | ||
COPY . . | ||
|
||
# Creates a "dist" folder with the production build | ||
RUN npm run build | ||
|
||
# Start the server using the production build | ||
CMD [ "node", "dist/main.js" ] | ||
|
||
EXPOSE 3002/tcp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not Remove it if everything is commented out?