Skip to content

Instantly share code, notes, and snippets.

Avatar

Trần Văn Luận luandevpro

View GitHub Profile
View action.yml
name: "my hello action"
description: "say hello with GitHub Actions"
runs:
using: "docker"
image: "Dockerfile"
View actiond.md
Parameter Description Required
Name The name of your action. Helps visually identify the actions in a job.
Description A summary of what your action does.
Inputs Input parameters allow you to specify data that the action expects to use during runtime. These parameters become environment variables in the runner.
Outputs Specifies the data that subsequent actions can use later in
View actions.yml
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
View node.js.yml
name: Deploy application
on:
push:
branches: [ master ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
View result.text
jobs: is the base component of a workflow run
build: is the identifier we're attaching to this job
name: is the name of the job, this is displayed on GitHub when the workflow is running
steps: the linear sequence of operations that make up a job
uses: actions/checkout@v1 uses a community action called checkout to allow the workflow to access the contents of the repository
uses: ./action-a provides the relative path the action we've created in the action-a directory of the repository
with: is used to specify the input variables that will be available to your action in the runtime environment. In this case, the input variable is MY_NAME, and it is currently initialized to "Mona".
View node.js.yml
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
View Terminal
kubectl apply -f deployment-green.yaml
View deployment-green.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: green
spec:
minReadySeconds: 10
replicas: 3
selector:
matchLabels:
View Terminal
minikube service entry-point
View Terminal
kubectl apply -f service-blue-green.yaml