Skip to content

Commit

Permalink
Add devcontainers configuration file (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
FidelusAleksander authored Jan 12, 2024
1 parent 9cbbb90 commit a1ee758
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 26 deletions.
30 changes: 30 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Based on https://github.com/microsoft/vscode-dev-containers/blob/main/containers/hugo/.devcontainer/devcontainer.json

ARG NODE_VERSION=16
FROM mcr.microsoft.com/devcontainers/javascript-node:${NODE_VERSION}

# VARIANT can be either 'hugo' for the standard version or 'hugo_extended' for the extended version.
ARG VARIANT=hugo
# VERSION can be either 'latest' or a specific version number
ARG VERSION=latest

# Download Hugo
RUN apt-get update && apt-get install -y ca-certificates openssl git curl && \
rm -rf /var/lib/apt/lists/* && \
case ${VERSION} in \
latest) \
export VERSION=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') ;;\
esac && \
echo ${VERSION} && \
case $(uname -m) in \
aarch64) \
export ARCH=ARM64 ;; \
*) \
export ARCH=64bit ;; \
esac && \
echo ${ARCH} && \
wget -O ${VERSION}.tar.gz https://github.com/gohugoio/hugo/releases/download/v${VERSION}/${VARIANT}_${VERSION}_Linux-${ARCH}.tar.gz && \
tar xf ${VERSION}.tar.gz && \
mv hugo /usr/bin/hugo

EXPOSE 1313
38 changes: 38 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "GitHub Certified website",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update VARIANT to pick hugo variant.
// Example variants: hugo, hugo_extended
// Rebuild the container if it already exists to update.
"VARIANT": "hugo",
// Update VERSION to pick a specific hugo version.
// Example versions: latest, 0.73.0, 0,71.1
// Rebuild the container if it already exists to update.
"VERSION": "latest",
// Update NODE_VERSION to pick the Node.js version: 12, 14
"NODE_VERSION": "14"
}
},

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"codespaces": {
"openFiles": [
"CONTRIBUTING.md"
]
},
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
1313
],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "git submodule update --init --recursive",
"postStartCommand": "nohup bash -c 'hugo server &'"

}
45 changes: 27 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,54 @@
# Contributing to GitHub Certified
> **Warning**: We do not support the inclusion of questions directly copied from official GitHub certification exams. Please only submit original questions and content that you have created.`

The easiest way to contribute is by [opening an issue](https://github.com/FidelusAleksander/githubcertified/issues/new/choose). No contribution is too small - we encourage you to report any typos, unclear questions or feature requests.
>The easiest way to contribute is by [opening an issue](https://github.com/FidelusAleksander/githubcertified/issues/new/choose). No contribution is too small - we encourage you to report any typos, unclear questions or feature requests.

<!-- MarkdownTOC autolink="true" -->
- [Contribution process](#contribution-process)
- [Install Hugo](#install-hugo)
- [Two ways of running the project](#two-ways-of-running-the-project)
- [GitHub Codespaces](#github-codespaces-easy)
- [Local setup (traditional)](#local-setup-traditional)
- [Content Changes](#content-changes)
- [Adding new question](#adding-new-question)
- [Updating existing content](#updating-existing-content)

<!-- /MarkdownTOC -->

## Contribution process
In order to contribute a code/content change:
## Two ways of running the project

### GitHub Codespaces

A Codespace is an online development environment that runs in the cloud and is powered by Visual Studio Code where all dependencies for developing this project are already setup for you.

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/FidelusAleksander/githubcertified)

Once the Codespace installation is complete and you can go to forward port tab to see the link to the website running locally and start making [content changes](#content-changes).

### Local setup (traditional)
If You've decided to not use [GitHub Codespaces](https://codespaces.new/FidelusAleksander/githubcertified) but instead want to run the project locally, follow the steps below.
- [Fork](https://github.com/FidelusAleksander/githubcertified/fork) the repository
- Update the submodules to install the theme
- Install [Hugo](https://gohugo.io/installation/)
- Update the submodules to install the theme used in this project
```bash
git submodule update --init --recursive
```
- Make your changes
- Submit a pull request

## Install Hugo

Before contributing, ensure you have [Hugo](https://gohugo.io/installation/) installed for local testing.
## Content Changes
All of the site content in this repository is stored in [content/](https://github.com/FidelusAleksander/githubcertified/blob/master/content) directory and is written in markdown.

Make sure that the git submodule in this repository is updated and then launch the Hugo server with:

```bash
hugo server -D
```
Preview your changes at at http://localhost:1313
Start the Hugo server to see your changes live at http://localhost:1313
```bash
hugo server
```

## Content Changes

All of the content in this repository is stored in [content/](https://github.com/FidelusAleksander/githubcertified/blob/master/content) directory and is written in markdown.


### Adding new question

> **Warning**: We do not support the inclusion of questions directly copied from official GitHub certification exams. Please only submit original questions and content that you have created.`
1) Run one of the following commands to add a new question file. Change `XXX` to the next available number.

```bash
Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@
</a>
</p>

## How to use
## Welcome

The site is deployed @ https://githubcertified.com/
This project helps people on their journey to pass GitHub Certifications by providing study resources and mock practice exams.

This project is meant to be used through the website @ https://githubcertified.com/

## Contributing

We welcome contributions to improve and expand the site content.
If you have additional questions or topics that you believe would benefit those preparing for the GitHub Certification Exams,
feel free to submit a pull request.
Make sure to follow the guidelines outlined in [CONTRIBUTING](https://github.com/FidelusAleksander/githubcertified/blob/master/CONTRIBUTING.md)
You can solidify your knowledge and help others pass the exams at the same time by submitting mock exam questions that you have created.

## License
Make sure to follow the guidelines outlined in [CONTRIBUTING](https://github.com/FidelusAleksander/githubcertified/blob/master/CONTRIBUTING.md)

This project is licensed under the [MIT License](https://github.com/FidelusAleksander/githubcertified/blob/master/LICENSE).

## Contributors

Expand Down

0 comments on commit a1ee758

Please sign in to comment.