Skip to content

Instantly share code, notes, and snippets.

@parjun8840
parjun8840 / gorun.yaml
Created January 9, 2023 00:15
using official action "checkout" and executing go code
#.github/workflows/gorun.yaml
name: Gocode Actions demo
run-name: User- ${{ github.actor }}, building & running go application 🚀
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
@parjun8840
parjun8840 / name.go
Created January 9, 2023 00:16
our go code to execute inside runner
package main
import (
"fmt"
"runtime"
)
func main() {
fmt.Println("My name is: Arjun Pandey- parjun8840 & panjali8840")
fmt.Printf("Number of CPU: %d \n",runtime.NumCPU())
fmt.Printf("OS: %s",runtime.GOOS)
}
@parjun8840
parjun8840 / env_var.yaml
Last active January 14, 2023 02:41
ENV variable code
#.github/workflows/env_var.yaml
name: accessing information inside worfkflow
on: [push]
env:
WF_LEVEL_ENV: available for all jobs in this workflow
jobs:
echo-information:
env:
JOB_LEVEL_ENV: available for this specific job only
@parjun8840
parjun8840 / helm-pkg.yaml
Created January 14, 2023 04:34
Github Helm lint and packaging
#.github/workflows/helm-pkg.yaml
name: pushing helm package to the github
on: [push]
jobs:
helm-package:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v3
@parjun8840
parjun8840 / function.yaml
Last active January 14, 2023 13:07
functions demo for GitHub
-------"status-function-checks" Job will run only on pull_request------
name: functions check worfkflow
on: [push, pull_request]
jobs:
general-function-checks:
runs-on: ubuntu-latest
steps:
- name: print GitHub context
run: echo "${{ toJson(github) }}"
@parjun8840
parjun8840 / build.yaml
Created January 15, 2023 12:48
go test, build , run , upload artifacts , slack msg
on: [push]
name: go build
jobs:
build:
strategy:
matrix:
go-version: [1.18.x, 1.19.x]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
outputs:
@parjun8840
parjun8840 / build_failure.yml
Last active January 21, 2023 00:09
build_failure workflow with dummy build and test script
#gha01/.github/workflows/build_failure.yml
% cat build_failure.yml
on: [push]
jobs:
FailBuildIssueDemo:
runs-on: ubuntu-latest
steps:
- name: checkout the code
uses: actions/checkout@v3
- name: build
@parjun8840
parjun8840 / pull_request_template.md
Created January 21, 2023 03:59
pull request template

Description

Please include a summary of the change, feature or which issue is fixed.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
@parjun8840
parjun8840 / slacknotification.yml
Created January 21, 2023 09:36
slack notification for review process
#.github/workflows/slacknotification.yml
on:
pull_request:
types: [opened, reopened, synchronize]
name: notification-pr-open
jobs:
slack_msg_send:
if: github.event.pull_request.base.ref == 'main'
runs-on: ubuntu-latest
@parjun8840
parjun8840 / dockerbuild.yaml
Last active January 21, 2023 13:55
docker image build and push
# .github/workflows/dockerbuild.yaml
on:
push:
branches:
- main
paths:
- 'dockerimage/**'
jobs:
build:
runs-on: ubuntu-latest