Git Product home page Git Product logo

eficode-demo-environments-secrets's Introduction

๐Ÿš€ Environments and secrets

Demo repository for using Environments and Secrets in workflows.

  • โ— This is a template repository
  • โ— This demo contains GHEC/GHES-specific features
    • The Environments feature is only available for GHEC, GHES (>=v3.1), and public repositories
  • If you have a GHEC organization available, then please click Use this template to clone the repo into that organization
  • If you do not have a GHEC organization available, please run the demo in this repository. Just make sure to complete the Cleanup steps afterwards ๐Ÿก

Usage

Creating environments

  1. In the repository, go to Settings --> Environments
  2. Create an environment (e.g. test)
    • No additional settings
  3. Create another environment (e.g. prod)
    • Add a required reviewer (you can set yourself as the required reviewer)
    • The protection rules will be used later in the demo

Creating secrets

  1. In the organization, go to Settings --> Secrets (if you have org owner access to the organization. If not, skip this step.)
    • Add an org secret (e.g. MY_ORG_SECRET) with an arbitrary value
    • Show how org secrets can be scoped to specific repositories
  2. In the repository, go to Settings --> Secrets
    • Add a repository secret (e.g. MY_REPO_SECRET) with an arbitrary value
  3. In the repository, go to Settings --> Environments
    • For one of the environments, add an environment secret (e.g. MY_ENV_SECRET)

Using Environments and Secrets in a workflow

๐Ÿ’ก Ensure that the secrets and environments added above corresponds to what is defined in the workflow.

  1. Use one of the existing workflows in .github/workflows
  2. Walk through the syntax
  3. Trigger the workflow by opening a new PR and ensure it succeeds
    • E.g. edit one of the test files
  4. Show the environments GUI inside the PR (the Deployments section)
  5. Merge the PR
  6. If Required reviewers were added to the environment, the workflow should be halted until it is reviewed
  7. Show how to review a deployment, and ensure the job proceeds
  8. Show where to locate all Environments and deployments for the repository
    • The Environments section on the repository landing page
  9. Show the redaction of secrets in the workflows log

๐Ÿก Cleanup

  1. If the workflow was run in this repository, perform the following steps:
    • Delete all secrets created
    • Delete all environments created
    • Ensure any PRs are closed/merged
    • Delete any branches created

eficode-demo-environments-secrets's People

Contributors

sofusalbertsen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.