Skip to content

Commit

Permalink
ci: release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
aldy505 committed Jan 31, 2024
1 parent cabc3a3 commit c9280a2
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 15 deletions.
23 changes: 8 additions & 15 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,7 @@ jobs:
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@main
with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD
extra_args: --debug --only-verified
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2
Expand Down Expand Up @@ -56,18 +46,21 @@ jobs:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
flavor: |
Expand All @@ -77,7 +70,7 @@ jobs:
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
release:
types:
- published

jobs:
cd:
name: CD
needs:
- ci
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3

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

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
flavor: |
latest=true
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
21 changes: 21 additions & 0 deletions .github/workflows/secret-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Secret Scan

on:
push:
pull_request:

jobs:
trufflehog:
name: Trufflehog
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@main
with:
extra_args: --debug --only-verified

0 comments on commit c9280a2

Please sign in to comment.