SlideShare a Scribd company logo
Introduction to
GitHub Actions2019/05/15
Bo-Yi Wu
https://github.com/appleboy
About me
• Software Engineer in Mediatek
• Member of Drone CI/CD Platform
• Member of Gitea Platform
• Member of Gin Golang Framework
• Teacher of Udemy Platform: Golang + Drone
https://blog.wu-boy.com
GitHub Flow
14	
Develop
Git Push
Git Tag
Develop
Git Push
Git Tag
Testing
Deploy
Deploy
Deploy
Production
Staging
Production
Testing
Deploy
Staging
GitHub Flow + Git Flow
in opensource
https://github.com/go-gitea/gitea
CI/CD Platform
Drone Travis Jenkins
GitLab Circle Codeship
https://github.com/features/actions
Beta
https://github.com/marketplace?type=actions
Marketplace
https://developer.github.com/actions/
Developer Guide
Container Based
CI/CD Platform
Current runtime resource
• 1 virtual CPU
• Up to 3.75GB of memory
• 100GB of disk space
28Events
Write Simple Workflow
|-- hello-world (repository)
| |__ .github
| |__ main.workflow
|
workflow "Remote ssh commands" {
on = "push"
resolves = [
"Remote ssh commands",
]
}
main.workflow
action "Remote ssh commands" {
uses = "appleboy/ssh-action@master"
secrets = [
"HOST",
"PASSWORD",
]
args = [
"--user", "actions",
"--script", "whoami",
]
}
main.workflow
https://github.com/appleboy/ssh-action/actions
Download the docker image for caching
Cache layer
http://bit.ly/docker-cache-build
Scheduling a workflow
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of the month (1 - 31)
│ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
│ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
│ │ │ │ │
│ │ │ │ │
│ │ │ │ │
* * * * *
workflow "New workflow" {
on = "schedule(*/15 * * * *)"
resolves = ["Hello World"]
}
What’s problem in UI?
You can’t see the log in progress job
Cancelling workflow
But you can’t restart the job
http://www.thebrokeagent.com/wtf-listing-description-of-the-week/
$ git reset —soft HEAD^
$ git commit -a -m ‘foo’
$ git push origin master -f
Restart the job
Secrets in Github Actions
Setting -> Secrets in left sidebar
Introduction to GitHub Actions
action "Remote ssh commands" {
uses = "appleboy/ssh-action@master"
secrets = [
"HOST",
"PASSWORD",
]
args = [
"--user", "actions",
"--script", "whoami",
]
}
main.workflow
What’s problem in Secrets?
Don’t support
organization secrets
duplicate of secrets in many repository of organization
Don’t support
thirty party
secret service
You need to write
CLI flag in command
drone-ssh -u foo -p foopass -s whoami
drone-ssh -u bar -p barpass -s whoami
main.workflow
secrets = [
"PASSWORD",
]
args = [
"--user", "actions",
"--script", "whoami",
]
secrets = [
"PASSWORD",
]
args = [
"--user", "actions",
"--script", "whoami",
]
Server 01 Server 02
docker run -e PASSWORD=xxx appleboy/drone-ssh
-u actions -s whoami
main.workflow
secrets = [
"PASSWORD01",
]
args = [
"-p", "$PASSWORD01",
"--script", "whoami",
]
secrets = [
"PASSWORD02",
]
args = [
"-p", "$PASSWORD02",
"--script", "whoami",
]
Server 01 Server 02
action "Publish" {
needs = "Tag"
uses = "actions/npm@master"
args = "publish --access public"
secrets = ["NPM_AUTH_TOKEN"]
}
https://github.com/actions/npm
How to add multiple
auth token
of npm registry?
kind: pipeline
name: default
steps:
- name: build
image: appleboy/drone-ssh
environment:
USERNAME:
from_secret: username
PASSWORD:
from_secret: password
Creating GitHub Actions
|-- ssh-action (repository)
| |__ .github
| |__ main.workflow
| |__ Dockerfile
| |__ entrypoint.sh
| |__ README.md
| |__ LICENSE
Support any language you want
Dockerfile
FROM appleboy/drone-ssh:1.5.0-linux-amd64
# Github labels
LABEL "com.github.actions.name"="SSH Commands"
LABEL "com.github.actions.description"="some description"
LABEL "com.github.actions.icon"="terminal"
LABEL “com.github.actions.color"="gray-dark"
LABEL "repository"="https://github.com/appleboy/ssh-action"
LABEL "homepage"="https://github.com/appleboy"
LABEL "maintainer"="Bo-Yi Wu <appleboy.tw@gmail.com>"
LABEL "version"="0.0.1"
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
entrypoint.sh
#!/bin/sh
set -eu
export GITHUB="true"
sh -c "/bin/drone-ssh $*"
action "Tag Docker Image" {
needs = ["build"]
uses = "actions/docker/cli@master"
args = "tag hello:$GITHUB_SHA"
}
action "Tag Docker Image" {
needs = ["build"]
uses = "actions/docker/cli@master"
args = ["tag", "hello:$GITHUB_SHA"]
}
Environment variables
action "Hello World" {
uses = "./my-action"
env = {
FIRST_NAME = "Mona"
MIDDLE_NAME = "Lisa"
LAST_NAME = "Octocat"
}
}
runtime environment
GitHub Variable
• GITHUB_WORKFLOW
• GITHUB_ACTION
• GITHUB_EVNETNAME
• GITHUB_SHA
• GITHUB_REF
I don’t know how to
get the author
email, name or
commit message
Resolve this problem using GitHub API request?
Publishing your action
in the GitHub Marketplace
FROM appleboy/drone-ssh:1.5.0-linux-amd64
# Github labels
LABEL "com.github.actions.name"="SSH Commands"
LABEL "com.github.actions.description"="some description"
LABEL "com.github.actions.icon"="terminal"
LABEL “com.github.actions.color"="gray-dark"
LABEL "repository"="https://github.com/appleboy/ssh-action"
LABEL "homepage"="https://github.com/appleboy"
LABEL "maintainer"="Bo-Yi Wu <appleboy.tw@gmail.com>"
LABEL "version"="0.0.1"
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
please make sure that there is no problem with Dockerfile in LABEL
Create New Tag and
Publish Release
https://github.com/marketplace/actions/ssh-commands
Some action I created
• appleboy/ssh-action
• appleboy/scp-action
• appleboy/facebook-action
• appleboy/telegram-action
• appleboy/jenkins-action
• appleboy/gitlab-ci-ation
• appleboy/discord-action
http://bit.ly/golang-2019
http://bit.ly/drone-2019
Thank You

More Related Content

PDF
Introduction to GitHub Actions
Knoldus Inc.
 
PPTX
CICD Pipeline Using Github Actions
Kumar Shìvam
 
PDF
CI/CD with Github Actions
Md. Minhazul Haque
 
PDF
DevOps with GitHub Actions
Nilesh Gule
 
PPSX
CI-CD Jenkins, GitHub Actions, Tekton
Araf Karsh Hamid
 
PPTX
Introduction to Git and GitHub
Bioinformatics and Computational Biosciences Branch
 
PDF
GitHub Actions in action
Oleksii Holub
 
PPTX
SonarQube: Continuous Code Inspection
Michael Jesse
 
Introduction to GitHub Actions
Knoldus Inc.
 
CICD Pipeline Using Github Actions
Kumar Shìvam
 
CI/CD with Github Actions
Md. Minhazul Haque
 
DevOps with GitHub Actions
Nilesh Gule
 
CI-CD Jenkins, GitHub Actions, Tekton
Araf Karsh Hamid
 
GitHub Actions in action
Oleksii Holub
 
SonarQube: Continuous Code Inspection
Michael Jesse
 

What's hot (20)

PPTX
CI/CD with GitHub Actions
Swaminathan Vetri
 
PDF
Introduction to Github Actions
Knoldus Inc.
 
PPTX
Github in Action
Morten Christensen
 
PPTX
Using GitHub Actions to Deploy your Workloads to Azure
Kasun Kodagoda
 
PPTX
Container based CI/CD on GitHub Actions
Casey Lee
 
PPTX
GitHub Basics - Derek Bable
"FENG "GEORGE"" YU
 
PPTX
Github
MeetPatel710
 
PDF
github-actions.pdf
AbhaymithraReddy1
 
PDF
Git and github 101
Senthilkumar Gopal
 
PPTX
Github basics
Radoslav Georgiev
 
PDF
Gitlab, GitOps & ArgoCD
Haggai Philip Zagury
 
PPTX
Gitlab CI/CD
JEMLI Fathi
 
PDF
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
Edureka!
 
PDF
Intro to Github Actions @likecoin
William Chong
 
PPTX
GitLab.pptx
LeoulZewelde1
 
KEY
Git and GitHub
James Gray
 
PDF
Introduction to Github Actions
Knoldus Inc.
 
PPTX
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
Simplilearn
 
PDF
Introduction to Git and GitHub
Vikram SV
 
PPTX
Git and GitFlow branching model
Pavlo Hodysh
 
CI/CD with GitHub Actions
Swaminathan Vetri
 
Introduction to Github Actions
Knoldus Inc.
 
Github in Action
Morten Christensen
 
Using GitHub Actions to Deploy your Workloads to Azure
Kasun Kodagoda
 
Container based CI/CD on GitHub Actions
Casey Lee
 
GitHub Basics - Derek Bable
"FENG "GEORGE"" YU
 
Github
MeetPatel710
 
github-actions.pdf
AbhaymithraReddy1
 
Git and github 101
Senthilkumar Gopal
 
Github basics
Radoslav Georgiev
 
Gitlab, GitOps & ArgoCD
Haggai Philip Zagury
 
Gitlab CI/CD
JEMLI Fathi
 
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
Edureka!
 
Intro to Github Actions @likecoin
William Chong
 
GitLab.pptx
LeoulZewelde1
 
Git and GitHub
James Gray
 
Introduction to Github Actions
Knoldus Inc.
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
Simplilearn
 
Introduction to Git and GitHub
Vikram SV
 
Git and GitFlow branching model
Pavlo Hodysh
 
Ad

Similar to Introduction to GitHub Actions (20)

PDF
DWX 2022 - DevSecOps mit GitHub
Marc Müller
 
PDF
Drone CI/CD Platform
Bo-Yi Wu
 
PPTX
2012 coscup - Build your PHP application on Heroku
ronnywang_tw
 
PDF
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Yros
 
PPTX
Python from zero to hero (Twitter Explorer)
Yuriy Senko
 
PDF
Год в Github bugbounty, опыт участия
defcon_kz
 
PDF
Distributing UI Libraries: in a post Web-Component world
Rachael L Moore
 
PDF
Automatisation in development and testing - within budget [IronCamp prague 20...
David Lukac
 
PDF
Go Web Development
Cheng-Yi Yu
 
PDF
OSCamp #4 on Foreman | CLI tools with Foreman by Martin Bačovský
NETWAYS
 
PPTX
Golang 101 for IT-Pros - Cisco Live Orlando 2018 - DEVNET-1808
Cisco DevNet
 
PDF
CI workflow in a web studio
deWeb
 
PDF
DevFest 2022 - Cloud Workstation Introduction TaiChung
KAI CHU CHUNG
 
PDF
Lean Php Presentation
Alan Pinstein
 
PDF
Startup Camp - Git, Python, Django session
Juraj Michálek
 
ODP
From Code to Cloud - PHP on Red Hat's OpenShift
Eric D. Schabell
 
PDF
Logstash for SEO: come monitorare i Log del Web Server in realtime
Andrea Cardinale
 
ODP
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
Eric D. Schabell
 
KEY
PyCon AU 2012 - Debugging Live Python Web Applications
Graham Dumpleton
 
PDF
Analysing Github events with Neo4j
Christophe Willemsen
 
DWX 2022 - DevSecOps mit GitHub
Marc Müller
 
Drone CI/CD Platform
Bo-Yi Wu
 
2012 coscup - Build your PHP application on Heroku
ronnywang_tw
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Yros
 
Python from zero to hero (Twitter Explorer)
Yuriy Senko
 
Год в Github bugbounty, опыт участия
defcon_kz
 
Distributing UI Libraries: in a post Web-Component world
Rachael L Moore
 
Automatisation in development and testing - within budget [IronCamp prague 20...
David Lukac
 
Go Web Development
Cheng-Yi Yu
 
OSCamp #4 on Foreman | CLI tools with Foreman by Martin Bačovský
NETWAYS
 
Golang 101 for IT-Pros - Cisco Live Orlando 2018 - DEVNET-1808
Cisco DevNet
 
CI workflow in a web studio
deWeb
 
DevFest 2022 - Cloud Workstation Introduction TaiChung
KAI CHU CHUNG
 
Lean Php Presentation
Alan Pinstein
 
Startup Camp - Git, Python, Django session
Juraj Michálek
 
From Code to Cloud - PHP on Red Hat's OpenShift
Eric D. Schabell
 
Logstash for SEO: come monitorare i Log del Web Server in realtime
Andrea Cardinale
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
Eric D. Schabell
 
PyCon AU 2012 - Debugging Live Python Web Applications
Graham Dumpleton
 
Analysing Github events with Neo4j
Christophe Willemsen
 
Ad

More from Bo-Yi Wu (20)

PDF
Drone CI/CD 自動化測試及部署
Bo-Yi Wu
 
PDF
用 Go 語言打造多台機器 Scale 架構
Bo-Yi Wu
 
PDF
Job Queue in Golang
Bo-Yi Wu
 
PDF
Golang Project Layout and Practice
Bo-Yi Wu
 
PDF
Drone 1.0 Feature
Bo-Yi Wu
 
PDF
GraphQL IN Golang
Bo-Yi Wu
 
PPTX
Go 語言基礎簡介
Bo-Yi Wu
 
PPTX
drone continuous Integration
Bo-Yi Wu
 
PPTX
Gorush: A push notification server written in Go
Bo-Yi Wu
 
PPTX
用 Drone 打造 輕量級容器持續交付平台
Bo-Yi Wu
 
PPTX
用 Go 語言 打造微服務架構
Bo-Yi Wu
 
PPTX
Introduction to Gitea with Drone
Bo-Yi Wu
 
PDF
運用 Docker 整合 Laravel 提升團隊開發效率
Bo-Yi Wu
 
PDF
用 Go 語言實戰 Push Notification 服務
Bo-Yi Wu
 
PPTX
用 Go 語言打造 DevOps Bot
Bo-Yi Wu
 
PPTX
A painless self-hosted Git service: Gitea
Bo-Yi Wu
 
PPTX
Write microservice in golang
Bo-Yi Wu
 
PPTX
用 Docker 改善團隊合作模式
Bo-Yi Wu
 
PPTX
Git flow 與團隊合作
Bo-Yi Wu
 
PPTX
PHP & JavaScript & CSS Coding style
Bo-Yi Wu
 
Drone CI/CD 自動化測試及部署
Bo-Yi Wu
 
用 Go 語言打造多台機器 Scale 架構
Bo-Yi Wu
 
Job Queue in Golang
Bo-Yi Wu
 
Golang Project Layout and Practice
Bo-Yi Wu
 
Drone 1.0 Feature
Bo-Yi Wu
 
GraphQL IN Golang
Bo-Yi Wu
 
Go 語言基礎簡介
Bo-Yi Wu
 
drone continuous Integration
Bo-Yi Wu
 
Gorush: A push notification server written in Go
Bo-Yi Wu
 
用 Drone 打造 輕量級容器持續交付平台
Bo-Yi Wu
 
用 Go 語言 打造微服務架構
Bo-Yi Wu
 
Introduction to Gitea with Drone
Bo-Yi Wu
 
運用 Docker 整合 Laravel 提升團隊開發效率
Bo-Yi Wu
 
用 Go 語言實戰 Push Notification 服務
Bo-Yi Wu
 
用 Go 語言打造 DevOps Bot
Bo-Yi Wu
 
A painless self-hosted Git service: Gitea
Bo-Yi Wu
 
Write microservice in golang
Bo-Yi Wu
 
用 Docker 改善團隊合作模式
Bo-Yi Wu
 
Git flow 與團隊合作
Bo-Yi Wu
 
PHP & JavaScript & CSS Coding style
Bo-Yi Wu
 

Recently uploaded (20)

PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
The Future of Artificial Intelligence (AI)
Mukul
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Software Development Methodologies in 2025
KodekX
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 

Introduction to GitHub Actions