Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
[INT-1356][INT-1171] Add github action to build docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenan Warren committed Aug 12, 2021
1 parent 68e724c commit 804916f
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 12 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: build image

on:
push:
branches:
- main
tags:
- 'v*.*.*'
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: jupiterone/graph-kubernetes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
25 changes: 15 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
name: Build
on: [push, pull_request]
name: build

on:
push:
branches:
- main
tags:
- 'v*.*.*'
pull_request:
branches:
- main

jobs:
test:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [14.x]
os: [ubuntu-latest, macos-latest]

steps:
- id: setup-node
name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
node-version: 14.x

- name: Check out code repository source code
uses: actions/checkout@v2
Expand All @@ -31,10 +36,10 @@ jobs:

# Publishing is done in a separate job to allow
# for all matrix builds to complete.
release:
release-npm:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/main'
strategy:
fail-fast: false
matrix:
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/gitleaks.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
name: gitleaks

on: [push, pull_request]
on:
push:
branches:
- main
tags:
- 'v*.*.*'
pull_request:
branches:
- main

jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Check out code repository source code
uses: actions/checkout@v2

- name: gitleaks-action
uses: zricethezav/gitleaks-action@master

0 comments on commit 804916f

Please sign in to comment.