Miguel Palhas / @naps62

git push
<do stuff>

Not everything is a commit

@ Utrust

  • Multiple live environments:
     
    • Development
       
    • Staging/QA
       
    • Sandbox/Production

Deployed ASAP

~weekly

~weekly'ish


git checkout -b release-2020-01-14
workflows:
  deploy:
    jobs:
      - tests:
         ...
         
      - deploy:
         only:
           - /^release-.*/
           - master

CircleCI Config

git push
deploy

Wait... So only
developers can deploy??

workflows:
  deploy:
    jobs:
      - approval_step
          type: approval
         
      - deploy:
         requires:
           - approval_step

1. Github API

2. Github Actions

3. ChatOps

1. Github API

2. Github Actions

3. ChatOps

name: Github Action Example

on:
  push:
    branches:
      - master

jobs:
  ...

Triggers

name: Github Action Example

on:
  push:
  
  pull_request:
    types: [opened, synchronize]
    
  issue_comment:
    types: [created]

jobs:
  ...

Triggers

name: Github Action Example

jobs:
  test:
    runs-on: ubuntu-latest
    container: node:9.11.2
    
    steps:
      - name: Hello
        run: echo "Hello World"

Commands

name: Deploy

jobs:
  test:
    steps:
      - name: Checkout
        run: actions/checkout@v1

Reusable Actions

name: Test Suite
on:
  push:
    branches:
      - master
  pull_request:
    types: [opened, synchronize]

jobs:
  test:
    runs-on: ubuntu-latest
    container: node:9.11.2

    steps:
      - name: Checkout
        uses: actions/checkout@v1

      - name: Setup Cache
        uses: actions/cache@v1
        with:
          path: node_modules
          key: v1-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
          restore-keys: |
            v1-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
            v1-${{ runner.os }}

      - name: Install Packages
        run: npm install

      - name: Linters
        run: npm run lint

      - name: Tests
        run: npm test

Full Example

name: Deploy

on: [deployment]

jobs:
  test:
    steps:
      - name: Checkout
        run: actions/checkout@v1
        with:
          ref: ${{ github.event.deployment.ref }}

Reusable Actions



    steps:
      - name: Trigger Deploy
        uses: actions/github-script@0.3.0
        with:
          script: |
            const x = 1;
            console.log("wow, javascript!")
            await github.repos.createDeployment({
              # ...
            })

github-script

by the way...
$$$€€€฿฿฿

1. Github API

2. Github Actions

3. ChatOps

Watch:
ChatOps at GitHub - Jesse Newland
RubyFuza 2013

Miguel Palhas / @naps62

Continuous Stuff

By Miguel Palhas

Continuous Stuff

  • 99
Loading comments...

More from Miguel Palhas