SkillNavora
Git & GitHub Complete Guide › Lesson 7 of 8 · about 22 minutes
Lesson 7

GitHub Actions, Pages, releases and security features

Automate tests with a GitHub Actions workflow, publish a free website with GitHub Pages, tag versions and publish releases, and switch on Dependabot, secret scanning and code scanning.

Checked against official sources in November 2026. Lessons build on each other.
In plain words. GitHub Actions is a robot that does a chore every time something happens, such as running your tests on every pull request. Pages is free hosting for a website straight from your repository. Releases are labelled boxes of a finished version.

Key ideas

WorkflowA YAML file in .github/workflows/ that says when to run (on) and what to do (jobs and steps).
RunnerThe machine that runs a job (GitHub-hosted Linux, Windows or macOS, or your own).
SecretsEncrypted values (API keys) available to workflows, never printed in logs.
GitHub PagesFree static website hosting from a repository, at username.github.io or a custom domain.
Tag and releaseA tag names one commit (v1.0); a release adds notes and downloadable files.
DependabotAlerts and pull requests that update vulnerable or outdated dependencies.

How it works

1. Your first workflow: test every pull request

.github/workflows/tests.yml
name: tests
on:
  pull_request:
  push:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: pip install -r requirements.txt
      - run: pytest -q
  • Commit the file; the Actions tab shows each run and its logs.
  • Make the check required for main in your ruleset, so failing code cannot be merged.
  • Store keys in Settings › Secrets and variables › Actions and use them as ${{ secrets.API_KEY }}.
  • Pin actions to a version (or a commit SHA for third-party actions) and give workflows the least permissions they need.

2. Publish a website with GitHub Pages

  1. Put your site files (index.html and assets) in the repository, or build them with a workflow.
  2. Open Settings › Pages. Under Build and deployment, choose Deploy from a branch (main, root or /docs) or GitHub Actions.
  3. Wait a minute and open https://username.github.io/repository/.
  4. For your own domain, add it under Custom domain, create the DNS records your registrar needs, and tick Enforce HTTPS.
Careful. Pages sites are public unless your plan includes private Pages. Never publish private data or secrets on a Pages site.

3. Tags and releases

Real terminal output (captured when this guide was built)
$ git tag -a v1.0 -m "First complete set of notes"
$ git tag
v1.0
$ git show v1.0 --stat --format='%h %s'
tag v1.0
Tagger: Asha Learner <[email protected]>

First complete set of notes
1ee8249 Revert "Add a wrong fact"

 glossary.md | 1 -
 1 file changed, 1 deletion(-)
$ git push -q origin v1.0 && git ls-remote --tags origin
2ff02f39305b4137f405602cad721c3958d0c5e1	refs/tags/v1.0
1ee824981be5f41fefe948779fa71284523eb144	refs/tags/v1.0^{}

On GitHub open Releases, then Draft a new release, pick the tag, and select Generate release notes to list merged pull requests automatically. Use semantic versions: v1.4.2 means major.minor.patch.

4. Security features to switch on

FeatureWhat it doesWhere
Dependabot alerts and updatesWarns about vulnerable dependencies and opens update PRsSettings, Code security
Secret scanning and push protectionFinds committed tokens and blocks pushes with known secret patternsSettings, Code security
Code scanning (CodeQL)Finds security bugs in your code on every PRSecurity tab, Code scanning
Security policySECURITY.md tells people how to report vulnerabilitiesRepository root or .github/

5. Codespaces: a computer in the browser

Press . on a repository for a quick web editor, or open Code, Codespaces for a full cloud development environment with a terminal. A .devcontainer/devcontainer.json file sets up the same tools for everyone. Free personal usage is limited each month, so stop codespaces you are not using.

Common mistakes and fixes

MistakeFix
Printing secrets in workflow logsUse secrets, never echo them, and keep workflow permissions minimal.
Using unpinned third-party actionsPin to a version or a full commit SHA.
Expecting Pages to run a server or databasePages hosts static files only; use another service for back-end code.

Practice

  1. Add the tests workflow to a small Python project and make it fail, then pass.
  2. Publish a one-page portfolio with GitHub Pages.
  3. Turn on Dependabot alerts and secret scanning for your repositories.

Quick check

Where do workflow files live?

.github/workflows/ in the repository, as YAML files.

How do you stop failing code from being merged?

Make the workflow's status check required in the ruleset or branch protection for main.

What does push protection do?

Blocks pushes that contain known secret formats, such as API tokens.

Go further (official sources)

Refer & earn