Skip to content
Snippets Groups Projects
Select Git revision
  • main default protected
  • drip-server-timing
  • compress-middleware
  • v2.11.0
  • v2.10.0
  • v2.9.2
  • v2.9.1
  • v2.9.0
  • v2.8.0
  • v2.7.0
  • v2.6.0
  • v2.5.6
  • v2.5.5
  • v2.5.4
  • v2.5.3
  • v2.5.2
  • v2.5.1
  • v2.5.0
  • v2.4.2
  • v2.4.1
  • v2.4.0
  • v2.3.0
  • v2.2.2
23 results

continuous_delivery.yaml

Blame
  • continuous_delivery.yaml 2.25 KiB
    # This workflow implements continuous delivery with automated testing and fully
    # autonomous deploys to production on merge.
    name: CD
    
    # Translated: "Execute this workflow on pushes to main OR on pull requests
    # opened against main"
    #
    # See this question and answer for what we're solving here:
    # https://github.community/t5/GitHub-Actions/How-to-trigger-an-action-on-push-or-pull-request-but-not-both/m-p/36155#M2460
    on:
      push:
        branches: [main]
      pull_request:
        branches: [main]
    
    jobs:
      test:
        name: Test
        runs-on: ubuntu-latest
        steps:
        - name: Setup
          uses: actions/setup-go@v2
          with:
            go-version: '1.18'
    
        - name: Checkout
          uses: actions/checkout@v2
    
        - name: Build
          run: make build
    
        - name: Build docker image
          run: make image
    
        - name: Test
          run: git show --stat && make testci
    
        - name: Code coverage
          uses: codecov/codecov-action@v1
          with:
            file: ./coverage.txt
    
      regression_test:
        name: Regression Tests
        runs-on: ubuntu-latest
        strategy:
          matrix:
            go_version:
            - '1.17'
            - '1.16'
    
        steps:
        - name: Setup
          uses: actions/setup-go@v2
          with:
            go-version: ${{matrix.go_version}}
    
        - name: Checkout
          uses: actions/checkout@v2
    
        - name: Build
          run: make build
    
        - name: Test
          run: make test
    
      production_deploy:
        name: Production Deploy
        if: github.ref == 'refs/heads/main'
        runs-on: ubuntu-latest