GitHub 101

Before we begin

Organizational stuff

Who am I?

 Jakub Gutkowski 

Enjoying Life

@gutek

https://blog.gutek.pl

Contract

  1. Ask about anything!
  2. Make notes!
  3. Do your exercises, and we can guarantee you will gain an understanding of how things work
  4. There will be breaks during a day, but feel free to do a break when you need it

Goal of the workshop

Familiarize yourself with GitHub, GitHub features and GitHub flow

Workshop targets

  • Developers/DevOps
  • People not familiar with GitHub

To do exercises you will need

  • Editor (notepad, vim, vscode, etc)
  • git, installed locally (no previous knowledge required)
  • GitHub account

Follow us

link in chat

Git and GitHub

Agenda

  • Learn about what is Git
  • What are the building blogs of Git
  • Learn about what is GitHub
  • How GitHub relates to Git
  • Why use GitHub
  • GitHub
    • UI
    • Profile
    • SSH

Git

What is Git?

Created in 2005 by Linus Torvalds

For developing of Linux kernel

Distributed Version Control System

(open sourced) with collaborative and remote work in the heart

Centralized vs Distributed

Centralized vs Distributed

Centralized vs Distributed

Centralized

  • Good for large binary files
  • Security based on the folder structure
  • Smaller disk footprint
  • Hard to work offline

Distributed

  • Work fully offline
  • Local actions are extremely fast 
  • Might have a larger disk footprint (you're downloading the whole repository with all branches)
  • Many "backups"

Integrity

SHA-1

  • Everything is checksummed
  • Everything is  then referenced by that checksum
  • Everything is stored in git database is named by hash of its content
49e68ee44ba1c8bc093c5523635ddba5c4e6a55e

Shanpshots

most VCS

Shanpshots

git

Snapshots

Most VCS

  • Store file as one version
  • All changes to that file are store as delta/changes

Git

  • Store file as one version
  • Each commit is a picture of that current state
  • All changes to that file are stored as:
    • a new version
    • or pointer to the previous state

Three States

  • modified - changed, not yet committed
  • staged - ready to be committed
  • committed - its stored in local database/repository

Three Areas

  • Working directory (modified state)
  • Staging Area (staged state)
  • .git directory, repository (committed)

How popular is Git?

How popular is Git?

Are there disadvantages of using git?

  • Storing large binary files
  • No built-in access control
  • Learning curve if you have not been using similar VSC before
  • Getting repository can take longer

How to use git?

  • Install
  • Configure
  • Work with repositories

Installation

Configuration

git config --global user.name "John Doe"
git config --global user.email john@doe.com

# set default branch name to main
git config --global init.defaultBranch main

# optionally, change default editor:
git config --global core.editor "code --wait"
git config --global core.editor "nano"
git config --global core.editor "vim"

work with repositories

# create reposiotry
git init

# list folders
ls -la

# create file and add it
echo "THIS IS TEST" > README.md
git add README.md

# commit changes to current branch
git commit -m "add readme file"

demo: three states

git init
ls -la

echo "THIS IS TEST" > README.md
git status

git add README.md
git status

git commit -m "add readme file"
git status

echo "NEW CONTENT" > README.md
git status

git add .
git status

git commit -m "replacing file"

thats all?

  • no, there are many other commands
  • few we will be using soon
  • most we will not be used at all during a workshop
  • for a full list of commands see here
  • to learn more, read free book Pro Git

GitHub

What is GitHub?

A collaboration platform that uses git as a source for managing assets.

 

It happens to be mainly used by developers to create and collaborate on software projects, but it does not need to be.

What you can use GitHub for?

  • Explore projects, designs, documentation, books etc
  • Discussions/forum
  • Collaboration over the house/flat design, book or code
  • Learning by reading others code/design, books
  • As an online file editor
  • Hosting static pages, blog or JavaScript game, etc
  • And many many more

What's the difference between Git and GitHub?

None, two different products. It just happens that underneath nice UI and feature reach platform of GitHub, as a foundation, lays git, distributed version control system fuse some of the most advanced features of GitHub

Who is the target group of GitHub?

Developers/DevOps (the one that wants to be, junior, senior, past developers, etc) and then Organisations (with many developers ;))

basically anyone who wants to work with code

What they are gaining by using GitHub instead of pure git?

  • The management part of collaboration:
    • issues
    • pull requests
    • project boards
  • The social part of a collaboration
    • discussions
    • comments
    • reviews
  • The automation part
    • building
    • publishing
    • validating

Are there competitors to GitHub?

Yes

 

  • GitLab
  • Bitbucket
  • Azure DevOps
  • And few smaller with smaller set of features

Why GitHub?

Currently is used by 65+ million developers with an aim to reach 100 million in 2025

It hosts more than 200 million repositories and is used by over 3 million organisations including 72% of Fortune 50

Why GitHub?

Who is using GitHub?

Since 2018, GitHub is part of Microsoft

All Microsoft open source projects are hosted on GitHub

More than 2000 Google employees contribute to projects on Github

More than 2000 RedHat employees contribute to projects on GitHub

More than 1000 employees of IBM and Intel contributes to projects on GitHub


Almost every big company contributes or hosts projects on GitHub

 

So why don't you? :)

GitHub Main Features

Code

Issues

Pull Requests

Automation

Discussions

All of this for free?

All of this for free?

demo: GitHub

  • Open https://github.com
  • Home Screen
  • Profile Screen
  • Repository screen (with menu)
  • Profile Settings
  • Viewing another repository (EventFlow)
  • Traversing repository
  • Pressing .
  • Searching, advance searching

Everything in GitHub is around

REPOSITORIES

Accessing GitHub

  • Everyone can access the public repository
  • Only GitHub users can contribute to public repositories
  • Only GitHub users that have access rights can access and contribute to private repositories

demo: downloading repository

# open https://github.com/microsoft/muzic
# Code > 
#  - Open with GitHub Desktop
#  - Open with Visual Studio
#  - Download ZIP
#  - Clone - https/ssh

git clone https://github.com/microsoft/muzic.git
git clone git@github.com:microsoft/muzic.git

exercise: create GitHub account

Only do it if you do not have an account!

  • Open https://github.com/signup
  • Follow wizard
  • Login to GitHub

demo: configuring profile

  • Open https://github.com/settings
  • Configure Public profile
  • Account settings
  • Appearance
  • Account security
  • Security log
  • Notifications
  • Blocked users/Interaction limits

demo: setting up ssh

ssh-keygen -t ed25519 -C "github.email@address.com"
# ssh-keygen -t rsa -b 4096 -C "github.email@address.com"

# start ssh agent
eval "$(ssh-agent -s)"

# add key to ssh agent
ssh-add ~/.ssh/id_ed25519

cat ~/.ssh/id_ed25519.pub

# copy and paste it to GitHub

# test if you can log in
ssh -T git@github.com

Summary

  • We know what git is and how it works
  • We know what GitHub is and how UI looks
  • We can customize our profile
  • We can secure our profile
  • We can create and use SSH key to work with GitHub

GitHub
Repositories

Agenda

  • Creating Repository on GitHub
  • Working with Repository on GitHub
  • Administration
  • Special Files
  • Insights

Everything in GitHub is around

REPOSITORIES

demo: creating non empty repository

  • Open https://github.com/new
  • Provide name and description
  • Select visibility (Public)
  • Initialize with README, .gitignore and license MIT
  • Update description
  • Add Topics
  • Add Files
  • Do it with .

demo: creating empty repository

echo "# empty" >> README.md
git init
git add README.md
git commit -m "first commit"
# move branch/rename
git branch -M main
git remote add origin https://github.com/Gutek/NAME.git
git push -u origin main

# or
git remote add origin https://github.com/Gutek/NAME.git
git branch -M main
git push -u origin main

demo: configuring repository

  • Open repository settings page
  • Describe configuration pages

demo: templating repository

  • Open repository settings page
  • Enabling templating
  • Create a new repository from template
  • Check what was copied and what wasn't

demo: deleting repositories

  • Open repository settings page
  • Delete repository

exercise: working with repositories

  • Create repository template
  • Add description, license file, readme file
  • Add topics including template topic
  • Add file: your name, and with content your surname
  • Edit readme file
  • Remove features not used: Wiki, Issues, Project, Preserver this repository
  • Set it as a template
  • Create repository from template
  • Remove new repository but leave template repository

result: working with repositories

  • The template only copies files
  • It does not transfer repository settings

Special files

  • Files that GitHub Understands
  • Files that cause GitHub to do something special

demo: CODEOWNERS

  • Create file CODEOWNERS
  • Show CODEOWNERS in action

demo: README.md

  • Shows readme.md
  • Works in each folder
  • It's displayed on repository home page

demo: LICENSE

  • Describes what we can do with the source code
  • Shows human-readable description

demo: CONTRIBUTING.md

  • Describes how others can contribute to this repository

demo: CODE_OF_CONDUCT.md

  • Describes principles that contributors and others should follow when working with a repository

exercise: citation file

  • Add new file: CITATION.cff
  • Observe what is happening
  • Use example
  • Where do you find the results of that file?

result: citation file

  • After providing name: CITATION.cff git hub will provide hint
  • Same thing happens to most special files including templates

demo: CITATION.cff

  • Describes how to cite the repository

demo: SECURITY.md

  • Describes what versions are supported and how to report a vulnerability

There few more files

  • Issue templates
  • Pull request templates

exercise: add special files

  • In the template repository add special files
  • Include:
    • Citation
    • Code owners
    • Code of conduct
    • Contributing
    • License (if not present)
    • Readme (if no present)

exercise: move files to .github

  • create .github folder
  • Move files to that folder
    • Citation
    • Code owners
    • Contributing
  • What options are working, what are not?

demo: Insights

  • Open repository Insights
  • Describe sections

demo: Security

  • Open repository Security sections
  • Describe sections

exercise: security 

  • In template repository
  • Add Security Policy
  • Create and Publish Security Advisory
  • Close/Remove Security Advisory

result: security 

  • You can't delete/remove Advisory
  • Only GitHub can do it
  • Be careful when you play with this on your official repository

demo: wiki

  • Open template repository
  • Open Wiki section
  • Create Wiki with two docs
  • Show where the wiki is stored

Wiki

  • Used to be used a lot
  • Some old projects still have documentation on Wiki
  • New projects are mainly not using this
  • Consider this a legacy feature

Forks

  • Creates a copy of the repository
  • In that copy, we can do whatever we want
  • It's our repository, not someone else repository
  • This is how we can collaborate with public and private repositories

demo: Fork

  • Create a fork of a template repository
  • Add file
  • Create Pull Request (we will be discussing them soon)

Summary

  • We created a repository with and without files
  • We've configured the repository 
  • We've created special files
  • We've created Wiki pages
  • We've been working with Forks
  • We also understand what Insights and Security sections of repository are

GitHub
Issues

Agenda

  • What are Issues
  • What are Projects
  • What are Labels
  • What are Milestones
  • How to work with projects and issues
  • How to create Issue Templates

What are Issues?

  • Work item, tasks, question, bug, user story
  • Way to discuss around a particular item
  • Way to classify an item (owner, project, milestone, etc)

What are Projects?

  • A way to managing work around issues
  • It's basically a board like Trello, Kanban etc.

What are Projects?

  • Boards can be managed manually or automatically
  • It helps see what's the current status
  • Projects are not needed to work with Issues
  • One issue can be assigned to many projects
  • Can be used to filter issues

What are Labels?

  • A way to classify Issue
  • Tags
  • Can be used to filter issues

What are Milestones?

  • A way to group Issue
  • Can be used to filter issues

demo: working with issues

  • Create Project with Automation
  • Create Label and Milestone
  • Create Issue, assign project and label and milestone
  • Pin issue
  • Create new issue and reference created previously issue in the description
  • Create a new issue and reference issue in a comment
  • Close Issue
  • Show repo with many issues

demo: issues template

  • Create a new issue template by opening Insights / Community
  • Create issue using that template

excersie: Issues

  • Create a project with an automatic kanban board
  • Create Milestone and Label for user stories
  • Create Issue template for User Story with auto labelling and assignment
  • Create two issues of type User Story
  • Assign them to Milestone and Project
  • Check Project board
  • Move one Use Story to Done, other to In Progress
  • Check the status of the User Story that is in Done
  • Open User Story in In Progress and close issue
  • Check board again

result: Issues

  • Automation of issues works only when we execute them on Issue, not on board
  • Moving items on the board only influences the activity feed of the issue, it does not change it status

Issues Template

  • We can do more:
    • we can customize forms and fields
    • we can customize validation
    • we can customize what options are available for creating new issue

demo: issue form template

Summary

  • We know what issues and projects are
  • We know how to use them
  • We know how to work with labels and milestones
  • We know how to create an issue templates

GitHub
Discussions

Agenda

  • What are discussions?
  • How to enable discussions?

What are Discussions?

It's a collaborative space where the community can discuss around project and or initiative

 

It fills the gap that Issues had created - where to discuss proposition, ask questions, share ideas

 

Issues have different contexts and meanings, mixing it adds cognitive load to daily work

demo: how discussions are used

demo: enabling discussions

  • Create and setup discussions in the repository
  • Create issue from discussion
  • Revert issue into discussion

Summary

  • We know what Discussion are
  • We know how others use Discussions
  • We know how to enable the Discussion feature
  • We know how to convert an issue into discussion
  • We know how to convert discussion into issue

GitHub
Releases

Agenda

  • What are releases?
  • What are tags?
  • Why do we talk about tags when we talk about releases?

Tags

Releases

What are releases?

  • The release is a snapshot of code and information around a specific version of the code
  • When we create a new version of the product, we create a new release that includes built assemblies, executables, release notes and all other assets needed to run or deploy our release
  • New releases in GitHub comes with a zipped version of the repository of the given time (from which we create release)

What are tags?

  • Tag is a git concept
  • It allows bookmarking specific points of time during development
  • Each tag is assigned to a specific commit on a specific branch
  • We can easily switch between bookmarks
  • We can use bookmarks to make important stages/states of our solution
  • One way to use it is to set tag as version

What's the relation between tag and release?

Releases use tags to mark specific points of time, for which release is created

In GitHub, releases are extensions of tags

How to create release?

We can create them only on GitHub

We need to specify a tag, that specifies the point in time of the repository

How to create tag?

From command line git tag

When creating new release in GitHub

demo: tag from command line

# create simple tag of current commit
git tag TAG_NAME

# get commit id
git log

# creates tag for specific commit
git tag NEW_TAG b66c75ba

# creates commit with annotiations (dates etc)
git tag -a A_TAG -m "message"

# to push tags to GitHub
git push --tags

demo: create release and tag

  • Open releases section
  • Create new release
  • Show tags we pushed before
  • Specify tag (ask for creation)
  • Add notes
  • Create release
  • Show tags and releases

Summary

  • We know what are releases
  • We know what are tags
  • We know what's the relation between release and tag
  • We know how to create releases and tags

GitHub
Pages

Agenda

  • What are GitHub Pages?
  • How to create Github Page?

What are GitHub Pages?

  • Static files hosted on GitHub and rendered like a normal page
  • Dynamic page rendered using Jekyll

demo: GitHub Pages

  • open devWarsztaty
  • Show Settings and Pages
  • Modify index.html file
  • Show changes applied (might take some time)

excercise: GitHub Pages

  • Create new repository
  • add index.html file
  • Turn on GitHub pages
  • Access page
  • (optionally) Turn on Jekyll

GitHub Pages

  • Being able to host pages even static one removes needs for Wiki
  • We can host documentation of our project and only ask GitHub to serve content from /docs folder
  • Or we can create community-driven blog, that everyone can fix typos, or propose changes to our post

Summary

  • We know what are GitHub Pages
  • We know how to turn them on
  • We know how and when to use them

GitHub
Pull Requests

Agenda

  • What are Branches?
  • What are Pull Requests?
  • What is GitHub Flow?
  • How to work with Pull Requests
  • How to create Pull Request template
  • Pul Request Reviewers automation in organizations

What are branches?

  • Basic git concept
  • It's a "named" group of commits

Shall we use branches?

  • YES!!!
  • It's a cheap concept - git was build to be fast and to enable nonlinear work, branches allow us to do this
  • It's fast, it's safe and it creates a working area for a specific bug, tests, feature
  • It can be merged back to main/master (or other) branch

How does it work?

How does it work?

  • At a specific moment in time, many devs might work on the same repository
  • Each dev working on its own branch
  • Branch might be local (available only on dev computer)
  • Or Branch might be remote (available on the server too)
  • Local branches are accessible only by single dev, a remote one, by the whole team

How to create a branch in git?

# create branch from current branch/commit
# and change to this new branch
git checkout -b BRANCH_NAME

# same as above, but slower
git branch BRANCH_NAME
git checkout BRANCH_NAME

# list local branches
git branch

# list all branches, including remote (that we know of)
git branch -a

# delete branch
git branch -d BRANCH_NAME

# merge/rebase branch to current branch
git merge SOURCE_BRANCH
git rebase SOURCE_BRANCH

What are Pull Requests?

  • Main GitHub Concept
  • That made GitHub famous
  • That set a new standard in the development process
  • Simply put: it's a review process of the Merge/Rebase operation

What are Pull Requests?

  • Its GitHub feature builded on top of branches
  • Allows coordinators, to review changes before they will be merged or rejected
  • It combines:
    • code comments
    • discussions
    • issues linking
    • automation

Prons of Pull Requests

  • Peer review
  • Testing and better stability
  • Reducing conflicts during merge
  • Clearer responsibilities
  • Possible automation

Cons of Pull Requests

  • The more changes/commits the harder to review (problem with tooling and cognitive load)
  • Might increase the feedback loop
  • It's easier to fix, then explain the fix
  • Maturity of reviewer

Should I use Pull Requests?

  • Yes!!! 
    • You have no other options in GitHub
    • If you work with branches, you will have Pull Requests
  • No!!!
    • that depends on your project type and requirements...
    • ... and platform

Pull Requests and CODEOWNERS

If CODEOWNERS file exists, Pull Request will automatically be assigned to people who are owners of specific files/paths defined in CODEOWNERS

 

How cool is that? 

What is GitHub Flow?

demo: Pull Request

  • Open repository
  • Create a branch in GitHub
  • Add file
  • Create a Pull Request
  • Show "automation"
  • Convert to draft and back
  • Assign a Pull Request to project
  • Show project board
  • Add comment to code
  • Create issue from code line
  • Merge Pull Request

excersie: Pull Request

  • Create an issue in the repository
  • Fork repository
  • Add file/pretend to fix something
  • Create Pull Request
  • Reference issue in Pull Request
  • Merge Pull Request

result: Pull Request

  • The issue should be referenced by Pull Request
  • It might be closed (depending on the wording, if Closes #issue_no was used) when PR is approved
  • We can also reference issues with commit message - just add #issue_no

demo: Resolving Conflicts

  • Open repository
  • Create branch
  • Edit readme.md file by changing text
  • Move back to main, and do similar change but with different text
  • Move back to the created branch, create Pull Request
  • Resolve conflict in Pull Request

demo: pull request template

  • Open repository
  • Create folder .github
  • Create file pull_request_template.md
  • In file, you can add whatever content
  • Create branch
  • Do changes
  • Create Pull Request

Many Pull Request Templates

  • GitHub allows having more than one template
  • Usage is not that straightforward
  • In .github we need to create a PULL_REQUEST_TEMPLATE folder
  • Each file inside it will be a template
  • To use it we need to pass template query string param in URL

Pull Request Review Assignment Automation

  • Feature only available in organizations on team level
  • Can automatically using Lod balance or Round Robin assign reviewers to Pull Requests
  • Only available in pay plan for organization

Summary

  • We know what branches are
  • We know what Pull Requests are
  • We know what is the famous GitHub Flow
  • We know how to create a branch and Pull Request
  • We know how to resolve merge conflicts
  • We know how to create Pull Request templates
  • We know how to automatically assign Pull Requests to Reviewers 

GitHub
Dependency
Managment

Agenda

  • What problem do repositories have?
  • What is a Dependabot?
  • What are Dependabot alerts?
  • What are Code scanning alerts?
  • What is and how to use Dependency graph
  • How to enable Dependabot for updating depedencies

Info

From now on we will be using an application from the repository:

 

https://github.com/Gutek/sample-dotnet-app

What problem do repositories have?

To guarantee that code and all dependencies including references lib's, docker images, etc. are vulnerability free

What is a Dependabot?

  • It's one of the answers to problem that repositories have
  • It was a company that GitHub acquired
  • Right now it's a part of GitHub ecosystem
  • It's a tool that validates project dependencies
  • It can automatically bump up the version of dependency with a Pull Request

What are Dependabot alerts?

  • Alerts inform about the security problems in lib used directly or indirectly by our repository
  • Alert informs what is the problem and how you can fix it
  • With additional options turned on, Dependabot can bump up the version for that lib (not always possible)

demo: Depndabot alerts

  • Open repository security section
  • Turn on Alerts
  • Open Settings/Security and shows that the same thing can be configured there
  • Show option for auto-update vulnerable dependencies
  • Open devWarsztaty to show an example of a security alert

What are Code Scanning alerts?

  • Security alters about code
  • GitHub uses Microsoft CodeQL to analyse code
    • If CodeQL detects a problem, it creates an alert
    • By default, it works with security problems, not code quality
    • It can be configured to scan for code quality too
  • GitHub allows choosing different tools for code analyses (some requires additional payment)

demo: Code Scanning

sercurity

  • Open repository
  • Go to Settings/Security or Security and click: Set up code scanning
  • Show options
  • Choose CodeQL Analysis
  • Remove comments to show that is a simple file
  • Show Actions section
  • Show Code scanning alerts

demo: Code Scanning

quality

  • Open repository
  • In .github folder create file codeql/codeql-config.yml
name: "Security and Quality"

queries:
  - uses: security-and-quality
  • Edit file .github/workflows/codeql-analysis.yml
- name: Initialize CodeQL
  uses: github/codeql-action/init@v1
  with:
    languages: ${{ matrix.language }}
    config-file: ./.github/codeql/codeql-config.yml  # <-- add this line
  • Show Actions section

What is and how to use the Dependency graph?

  • Dependency Graph is an insight into our repository
  • It list dependency that our project depends on
  • It list project that depends on our project
  • It gives a good overview of dependency status in our project

demo: Dependency graph

  • Open repository
  • Open Settings and Security & analysis
  • Show how to enable/disable dependency graph
  • Show dependencies in Inisghts
  • Show EvenFlow dependents

demo: Dependabot for dependencies

  • Open repository
  • Open Insights, Dependency graph then Dependabot
  • If not enabled, enable it
  • Click Create Config file
  • In package-ecosystem provide nuget
  • More options are available
  • See Dependency graph then Dependabot
  • See report
  • Force re-run
  • Show pull request

Summary

  • We know how to automate security checks of depedencies
  • We know how to receive alerts about security issues
  • We know how to test code quality
  • We know how to auto-update dependencies with Pull Requests
  • We do not know what are Actions and Workflow yet!

GitHub
Actions

Agenda

  • What are Actions?
  • What can I do with Action?
  • What Actions are available?
  • What if Action I need does not exists?

Info

From now on we will be using an application from the repository:

 

https://github.com/Gutek/sample-dotnet-app

What are Actions?

Actions is a piece of code executing a specific task. Actions are used in Workflow. Workflows define jobs and steps that we can automatically execute depending on the trigger (push, pull request created etc)

 

We define workflows in yaml format and we store it in our repo

 

We have control of what we want to execute and in what order

What can I do with Actions?

  • Almost everything
  • We can even just print out a version of the node
  • Or we can build our application
  • Or we can run tests
  • Or we can deploy our application
  • Or we can create custom CHANGELOG depending on the commits messages
  • Almost our imagination is almost the only limitation

What Actions are avaliable?

  • Easier to say: which one is not
  • There are currently around 10k actions available
  • All actions can be browsed through Marketplace
  • From autogeneration of Changelog file, to... try to imagine something and then search for it

demo: Marketspace

demo: Automatic releases

demo: add dotnet build and test

  • Open repository
  • Click Actions
  • Click New Workflow
  • Click Set up this workflow for .NET
  • Commit changes and take a look at Actions
  • Create Pull Request and check what will happen

demo: add pacakge caching

  • Open repository
  • Click Actions
  • Click New Workflow
  • Use file dotnet-simple-cache.yml

demo: publish test results

  • Open repository
  • Click Actions
  • Click New Workflow
  • Use file dotnet-build-test-publish-artifact.yml

What to do if Action is not available?

  • We can wait when someone will create one
  • Or we can create one by ourselves

demo: Actions examples

Summary

  • We know what are Actions and Workflows
  • We know how to find Actions and sample Wofklows
  • We know how to use Actions and Workflows
  • We know what to do when Action is not avaliable

GitHub
Environments
and Packages

Agenda

  • What are Packages?
  • How we can use Packages?
  • What are Environments?
  • How to use Environments?

Info

From now on we will be using an application from the repository:

 

https://github.com/Gutek/sample-dotnet-app

What are Packages?

  • Packages are basically package repositories
  • Place where we can store packages
    • nuget,
    • container,
    • npm,
    • maven,
    • gradle,
    • rubygems
    • others that might be added in the future

How to publich Packages?

  • Using CLI of the given tool
  • Using Action automation

What are Environments?

  • The environment is a grouping idea
  • It groups jobs in workflows under a specific environment
  • It lets also configure environment specific secrets

How to use Environments?

  • We need to create them in Settings
  • In job we need to reference it:

    environment: env_name
  • The environment is a configuration property per job in workflow

demo: publishing nuget package

  • Open repository
  • Click Actions
  • Click New Workflow
  • Use file dotnet-build-package-publish.yml

demo: publishing docker image

  • Open repository
  • Click Actions
  • Click New Workflow
  • Use file docker-build-publish.yml

Summery

  • We know what are Packages
  • We know how to publish packages
  • We know what are Environments
  • We know how to reference Environment from actions

Summary

What we have learned

  • What is Git and Github
  • How to work with GitHub
  • How to work around repositories
    • how to create issues
    • pull requests
    • discussions
    • static pages
  • How to automate dependency managment
  • How to automate our work with actions
  • How to deploy application using actions

Is there more?

  • YES!!!
  • We've only touched the surface of the features
  • We did not talk about:
    • team management
    • organization management
    • features available to paying customers

Where can I learn more?

  • GitHub documentation is not best but its the best resource right now
  • Blogs and google
  • You will struggle - but there are hidden gems
  • Hope this documentation will improve with time

Thank You

 Jakub Gutkowski 

Enjoying Life

@gutek

https://blog.gutek.pl