diff --git a/.github/script/STEP b/.github/steps/-step.txt similarity index 100% rename from .github/script/STEP rename to .github/steps/-step.txt diff --git a/.github/steps/0-welcome.md b/.github/steps/0-welcome.md new file mode 100644 index 0000000..9ff13a5 --- /dev/null +++ b/.github/steps/0-welcome.md @@ -0,0 +1 @@ + diff --git a/.github/workflows/0-start.yml b/.github/workflows/0-welcome.yml similarity index 62% rename from .github/workflows/0-start.yml rename to .github/workflows/0-welcome.yml index e7b9c90..746ac68 100644 --- a/.github/workflows/0-start.yml +++ b/.github/workflows/0-welcome.yml @@ -1,23 +1,22 @@ -name: Step 0, Start +name: Step 0, Welcome # This step triggers after the learner creates a new repository from the template -# This step sets STEP to 1 -# This step closes
and opens
+# This workflow updates from step 0 to step 1. # This will run every time we create push a commit to `main` -# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows on: create: workflow_dispatch: -# Reference https://docs.github.com/en/actions/security-guides/automatic-token-authentication +# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication permissions: # Need `contents: read` to checkout the repository # Need `contents: write` to update the step metadata contents: write jobs: - # Get the current step from .github/script/STEP so we can + # Get the current step from .github/steps/-step.txt so we can # limit running the main job when the learner is on the same step. get_current_step: name: Check current step number @@ -27,7 +26,7 @@ jobs: uses: actions/checkout@v3 - id: get_step run: | - echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT + echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT outputs: current_step: ${{ steps.get_step.outputs.current_step }} @@ -37,9 +36,9 @@ jobs: # We will only run this action when: # 1. This repository isn't the template repository - # 2. The STEP is currently 0 - # Reference https://docs.github.com/en/actions/learn-github-actions/contexts - # Reference https://docs.github.com/en/actions/learn-github-actions/expressions + # 2. The step is currently 0 + # Reference: https://docs.github.com/en/actions/learn-github-actions/contexts + # Reference: https://docs.github.com/en/actions/learn-github-actions/expressions if: >- ${{ !github.event.repository.is_template && needs.get_current_step.outputs.current_step == 0}} @@ -54,10 +53,9 @@ jobs: with: fetch-depth: 0 # Let's get all the branches - # Update README to close
and open
- # and set STEP to '1' - - name: Update to step 1 - uses: skills/action-update-step@v1 + # In README.md, switch step 0 for step 1. + - name: Update to step 1 + uses: skills/action-update-step@v2 with: token: ${{ secrets.GITHUB_TOKEN }} from_step: 0 diff --git a/.github/workflows/1-first-codespace.yml b/.github/workflows/1-first-codespace.yml index b282307..2c8144b 100644 --- a/.github/workflows/1-first-codespace.yml +++ b/.github/workflows/1-first-codespace.yml @@ -1,25 +1,24 @@ name: Step 1, 1-Create codespace and push code # This step triggers after push to main -# This step sets STEP to 2 -# This step closes
and opens
+# This workflow updates from step 1 to step 2. # This will run every time we push to main -# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows on: workflow_dispatch: push: branches: - main -# Reference https://docs.github.com/en/actions/security-guides/automatic-token-authentication +# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication permissions: # Need `contents: read` to checkout the repository # Need `contents: write` to update the step metadata contents: write jobs: - # Get the current step from .github/script/STEP so we can + # Get the current step from .github/steps/-step.txt so we can # limit running the main job when the learner is on the same step. get_current_step: name: Check current step number @@ -29,7 +28,7 @@ jobs: uses: actions/checkout@v3 - id: get_step run: | - echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT + echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT outputs: current_step: ${{ steps.get_step.outputs.current_step }} @@ -39,9 +38,9 @@ jobs: # We will only run this action when: # 1. This repository isn't the template repository - # 2. The STEP is currently 1 - # Reference https://docs.github.com/en/actions/learn-github-actions/contexts - # Reference https://docs.github.com/en/actions/learn-github-actions/expressions + # 2. The step is currently 1 + # Reference: https://docs.github.com/en/actions/learn-github-actions/contexts + # Reference: https://docs.github.com/en/actions/learn-github-actions/expressions if: >- ${{ !github.event.repository.is_template && needs.get_current_step.outputs.current_step == 1 }} @@ -65,10 +64,9 @@ jobs: FILE: "index.html" SEARCH: "Hello from the codespace" - # Update README to close
and open
- # and set STEP to '2' - - name: Update to step 2 - uses: skills/action-update-step@v1 + # In README.md, switch step 1 for step 2. + - name: Update to step 2 + uses: skills/action-update-step@v2 with: token: ${{ secrets.GITHUB_TOKEN }} from_step: 1 diff --git a/.github/workflows/2-custom-image.yml b/.github/workflows/2-custom-image.yml index ec48d33..371304a 100644 --- a/.github/workflows/2-custom-image.yml +++ b/.github/workflows/2-custom-image.yml @@ -1,25 +1,24 @@ name: Step 2, 2-custom image check # This step triggers after First Codespace -# This step sets STEP to 3 -# This step closes
and opens
+# This workflow updates from step 2 to step 3. # This will run every time we push to main -# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows on: workflow_dispatch: push: branches: - main -# Reference https://docs.github.com/en/actions/security-guides/automatic-token-authentication +# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication permissions: # Need `contents: read` to checkout the repository # Need `contents: write` to update the step metadata contents: write jobs: - # Get the current step from .github/script/STEP so we can + # Get the current step from .github/steps/-step.txt so we can # limit running the main job when the learner is on the same step. get_current_step: name: Check current step number @@ -29,7 +28,7 @@ jobs: uses: actions/checkout@v3 - id: get_step run: | - echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT + echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT outputs: current_step: ${{ steps.get_step.outputs.current_step }} @@ -39,9 +38,9 @@ jobs: # We will only run this action when: # 1. This repository isn't the template repository - # 2. The STEP is currently 2 - # Reference https://docs.github.com/en/actions/learn-github-actions/contexts - # Reference https://docs.github.com/en/actions/learn-github-actions/expressions + # 2. The step is currently 2 + # Reference: https://docs.github.com/en/actions/learn-github-actions/contexts + # Reference: https://docs.github.com/en/actions/learn-github-actions/expressions if: >- ${{ !github.event.repository.is_template && needs.get_current_step.outputs.current_step == 2 }} @@ -65,10 +64,9 @@ jobs: FILE: ".devcontainer/devcontainer.json" SEARCH: "mcr.microsoft.com/vscode/devcontainers/universal:latest" - # Update README to close
and open
- # and set STEP to '3' - - name: Update to step 3 - uses: skills/action-update-step@v1 + # In README.md, switch step 2 for step 3. + - name: Update to step 3 + uses: skills/action-update-step@v2 with: token: ${{ secrets.GITHUB_TOKEN }} from_step: 2 diff --git a/.github/workflows/3-customize-codespace.yml b/.github/workflows/3-customize-codespace.yml index 11356ab..068d5e9 100644 --- a/.github/workflows/3-customize-codespace.yml +++ b/.github/workflows/3-customize-codespace.yml @@ -1,25 +1,24 @@ name: Step 3, 3-Customize Codespace # This step triggers after we push to main -# This step sets STEP to 4 -# This step closes
and opens
+# This workflow updates from step 3 to step 4. # This will run every time -# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows on: workflow_dispatch: push: branches: - main -# Reference https://docs.github.com/en/actions/security-guides/automatic-token-authentication +# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication permissions: # Need `contents: read` to checkout the repository # Need `contents: write` to update the step metadata contents: write jobs: - # Get the current step from .github/script/STEP so we can + # Get the current step from .github/steps/-step.txt so we can # limit running the main job when the learner is on the same step. get_current_step: name: Check current step number @@ -29,7 +28,7 @@ jobs: uses: actions/checkout@v3 - id: get_step run: | - echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT + echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT outputs: current_step: ${{ steps.get_step.outputs.current_step }} @@ -39,9 +38,9 @@ jobs: # We will only run this action when: # 1. This repository isn't the template repository - # 2. The STEP is currently 3 - # Reference https://docs.github.com/en/actions/learn-github-actions/contexts - # Reference https://docs.github.com/en/actions/learn-github-actions/expressions + # 2. The step is currently 3 + # Reference: https://docs.github.com/en/actions/learn-github-actions/contexts + # Reference: https://docs.github.com/en/actions/learn-github-actions/expressions if: >- ${{ !github.event.repository.is_template && needs.get_current_step.outputs.current_step == 3 }} @@ -65,10 +64,9 @@ jobs: FILE: ".devcontainer/devcontainer.json" SEARCH: "postCreateCommand" - # Update README to close
and open
- # and set STEP to '4' - - name: Update to step 4 - uses: skills/action-update-step@v1 + # In README.md, switch step 3 for step 4. + - name: Update to step 4 + uses: skills/action-update-step@v2 with: token: ${{ secrets.GITHUB_TOKEN }} from_step: 3 diff --git a/.github/workflows/4-personalize-codespace.yml b/.github/workflows/4-personalize-codespace.yml index 8fc7f53..5bd3ac1 100644 --- a/.github/workflows/4-personalize-codespace.yml +++ b/.github/workflows/4-personalize-codespace.yml @@ -1,11 +1,10 @@ name: Step 4, 4-Personalize your Codespace # This step triggers after push to main#setup.sh -# This step sets STEP to X -# This step closes
and opens
+# This workflow updates from step 4 to step X. # This will run every time we push to main#setup.sh -# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows on: workflow_dispatch: push: @@ -14,14 +13,14 @@ on: paths: - 'setup.sh' -# Reference https://docs.github.com/en/actions/security-guides/automatic-token-authentication +# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication permissions: # Need `contents: read` to checkout the repository # Need `contents: write` to update the step metadata contents: write jobs: - # Get the current step from .github/script/STEP so we can + # Get the current step from .github/steps/-step.txt so we can # limit running the main job when the learner is on the same step. get_current_step: name: Check current step number @@ -31,7 +30,7 @@ jobs: uses: actions/checkout@v3 - id: get_step run: | - echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT + echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT outputs: current_step: ${{ steps.get_step.outputs.current_step }} @@ -41,9 +40,9 @@ jobs: # We will only run this action when: # 1. This repository isn't the template repository - # 2. The STEP is currently 4 - # Reference https://docs.github.com/en/actions/learn-github-actions/contexts - # Reference https://docs.github.com/en/actions/learn-github-actions/expressions + # 2. The step is currently 4 + # Reference: https://docs.github.com/en/actions/learn-github-actions/contexts + # Reference: https://docs.github.com/en/actions/learn-github-actions/expressions if: >- ${{ !github.event.repository.is_template && needs.get_current_step.outputs.current_step == 4}} @@ -67,10 +66,9 @@ jobs: FILE: "setup.sh" SEARCH: "install sl" - # Update README to close
and open
- # and set STEP to 'X' - - name: Update to step X - uses: skills/action-update-step@v1 + # In README.md, switch step 4 for step X. + - name: Update to step X + uses: skills/action-update-step@v2 with: token: ${{ secrets.GITHUB_TOKEN }} from_step: 4 diff --git a/README.md b/README.md index b21b462..62861cd 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,9 @@ _Create workflows that enable you to use Continuous Integration (CI) for your projects._
@@ -29,9 +26,15 @@ GitHub Codespaces is a development environment that's hosted in the cloud. - **What you'll learn**: How to create a codespace, push code from a codespace, select a custom image, and customize a codespace. - **What you'll build**: A codespace with devcontainer.json files, customizations, and personalizations. - **Prerequisites**: If you need to learn about Visual Studio Code, read [Visual Studio Code Docs](https://code.visualstudio.com/docs) first. -- **How long**: This course is four steps long and can be completed in less than an hour. +- **How long**: This course can be completed in less than an hour. -## How to start this course +In this course, you will: + +1. +2. +3. + +### How to start this course