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

What's hot (20)

PPTX
Using GitHub Actions to Deploy your Workloads to Azure
Kasun Kodagoda
 
PPTX
Introduction to Gitlab | Gitlab 101 | Training Session
Anwarul Islam
 
PPTX
Container based CI/CD on GitHub Actions
Casey Lee
 
PDF
Gitlab ci-cd
Dan MAGIER
 
PDF
Continuous Integration/Deployment with Gitlab CI
David Hahn
 
PPTX
Git branching strategies
jstack
 
PPTX
Github in Action
Morten Christensen
 
PPTX
CI/CD on AWS
Bhargav Amin
 
PPTX
BitBucket presentation
Jonathan Lawerh
 
PDF
Gitlab, GitOps & ArgoCD
Haggai Philip Zagury
 
PDF
Devops Porto - CI/CD at Gitlab
Filipa Lacerda
 
PPTX
Jenkins tutorial
Mamun Rashid, CCDH
 
PDF
Intro to Github Actions @likecoin
William Chong
 
PPTX
Transforming Organizations with CI/CD
Cprime
 
PDF
Kubernetes Basics
Eueung Mulyana
 
PDF
github-actions.pdf
AbhaymithraReddy1
 
PPTX
CI/CD with GitHub Actions
Swaminathan Vetri
 
PDF
CI with Gitlab & Docker
Joerg Henning
 
PDF
DevOps with GitHub Actions
Nilesh Gule
 
PPTX
Git One Day Training Notes
glen_a_smith
 
Using GitHub Actions to Deploy your Workloads to Azure
Kasun Kodagoda
 
Introduction to Gitlab | Gitlab 101 | Training Session
Anwarul Islam
 
Container based CI/CD on GitHub Actions
Casey Lee
 
Gitlab ci-cd
Dan MAGIER
 
Continuous Integration/Deployment with Gitlab CI
David Hahn
 
Git branching strategies
jstack
 
Github in Action
Morten Christensen
 
CI/CD on AWS
Bhargav Amin
 
BitBucket presentation
Jonathan Lawerh
 
Gitlab, GitOps & ArgoCD
Haggai Philip Zagury
 
Devops Porto - CI/CD at Gitlab
Filipa Lacerda
 
Jenkins tutorial
Mamun Rashid, CCDH
 
Intro to Github Actions @likecoin
William Chong
 
Transforming Organizations with CI/CD
Cprime
 
Kubernetes Basics
Eueung Mulyana
 
github-actions.pdf
AbhaymithraReddy1
 
CI/CD with GitHub Actions
Swaminathan Vetri
 
CI with Gitlab & Docker
Joerg Henning
 
DevOps with GitHub Actions
Nilesh Gule
 
Git One Day Training Notes
glen_a_smith
 

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
 
Ad

Recently uploaded (20)

PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
Survival Models: Proper Scoring Rule and Stochastic Optimization with Competi...
Paris Women in Machine Learning and Data Science
 
PDF
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
NASA A Researcher’s Guide to International Space Station : Fundamental Physics
Dr. PANKAJ DHUSSA
 
PPTX
Talbott's brief History of Computers for CollabDays Hamburg 2025
Talbott Crowell
 
PPTX
Manual Testing for Accessibility Enhancement
Julia Undeutsch
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
 
PDF
Software Development Company Keene Systems, Inc (1).pdf
Custom Software Development Company | Keene Systems, Inc.
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Survival Models: Proper Scoring Rule and Stochastic Optimization with Competi...
Paris Women in Machine Learning and Data Science
 
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
NASA A Researcher’s Guide to International Space Station : Fundamental Physics
Dr. PANKAJ DHUSSA
 
Talbott's brief History of Computers for CollabDays Hamburg 2025
Talbott Crowell
 
Manual Testing for Accessibility Enhancement
Julia Undeutsch
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
 
Software Development Company Keene Systems, Inc (1).pdf
Custom Software Development Company | Keene Systems, Inc.
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 

Introduction to GitHub Actions