|
| 1 | +# Using GitHub Codespaces |
| 2 | + |
| 3 | +## What is GitHub Codespaces? |
| 4 | + |
| 5 | +GitHub Codespaces is a cloud-based development environment that allows you to run your code directly from within GitHub. It provides a fully-featured, configurable, and on-demand development environment that can be accessed from anywhere. With GitHub Codespaces, you can: |
| 6 | + |
| 7 | +- Develop in a consistent environment across different machines. |
| 8 | +- Quickly start coding without setting up your local environment. |
| 9 | +- Use powerful cloud-based resources for development. |
| 10 | + |
| 11 | +## How to Spin Up a Codespace Instance |
| 12 | + |
| 13 | +Follow these steps to spin up a Codespace instance using the `devcontainer` file: |
| 14 | + |
| 15 | +### Step 1: Navigate to Your Repository |
| 16 | + |
| 17 | +1. Go to your repository on GitHub. In this case, navigate to [qldgov-sandbox/copilot-node-calculator](https://github.com/qldgov-sandbox/copilot-node-calculator). |
| 18 | + |
| 19 | +### Step 2: Open Codespaces |
| 20 | + |
| 21 | +2. Click on the `Code` button on the repository page. |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +3. Select the `Codespaces` tab. |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +4. Click on `New codespace` to create a new Codespace. |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +### Step 3: Configure Your Codespace |
| 34 | + |
| 35 | +5. GitHub Codespaces will automatically detect the `devcontainer.json` file in your repository and use it to set up your development environment. |
| 36 | + |
| 37 | +6. Wait for the Codespace to start. This might take a few minutes as it sets up the environment according to the configurations specified in the `devcontainer.json` file. |
| 38 | + |
| 39 | +### Step 4: Start Coding |
| 40 | + |
| 41 | +7. Once the Codespace is ready, you will be taken to a VS Code-like interface in your browser. You can now start coding in the environment that has been set up according to your `devcontainer.json` file. |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +### Step 5: Accessing Terminal and Other Features |
| 46 | + |
| 47 | +8. You can access the terminal by clicking on the menu and selecting `View > Terminal`. |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | +9. Use the terminal to run commands, install dependencies, and test your code. |
| 52 | + |
| 53 | +### Additional Tips |
| 54 | + |
| 55 | +- You can customize your development environment further by modifying the `devcontainer.json` file. |
| 56 | +- Codespaces supports extensions, themes, and other VS Code features, which you can install to enhance your development experience. |
| 57 | + |
| 58 | +## Conclusion |
| 59 | + |
| 60 | +GitHub Codespaces provides a powerful and flexible development environment that you can access from anywhere. By following the steps above, you can quickly spin up a Codespace instance and start coding using the `devcontainer.json` file you created. |
0 commit comments