Skip to content

Commit 9d03637

Browse files
committed
Add github workflow
1 parent a6fe141 commit 9d03637

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

.github/workflows/build.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build
2+
run-name: ${{ github.actor }} is building the app 🏗️
3+
on:
4+
# push
5+
workflow_dispatch:
6+
7+
jobs:
8+
build-musl:
9+
runs-on: ubuntu-latest
10+
if: github.actor == github.event.repository.owner.login
11+
12+
steps:
13+
- name: Run sccache-cache
14+
uses: mozilla-actions/sccache-action@v0.0.3
15+
16+
- uses: actions/checkout@v3
17+
18+
- run: rustup target add x86_64-unknown-linux-musl
19+
20+
- name: Install musl build tools
21+
run: sudo apt update && sudo apt install musl-tools -y
22+
23+
- name: Cargo build
24+
env:
25+
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
26+
run: cargo build --release --target x86_64-unknown-linux-musl
27+
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v2
31+
- name: Login to DockerHub
32+
uses: docker/login-action@v2
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.TOKEN }}
37+
38+
39+
- name: Build and push
40+
uses: docker/build-push-action@v3
41+
with:
42+
context: .
43+
file: Dockerfile
44+
push: true
45+
tags: |
46+
ghcr.io/guilamb/interspecies_reviewer:dev-latest
47+
ghcr.io/guilamb/interspecies_reviewer:dev-${{ github.run_number }}
48+
secrets: |
49+
"github_token=${{ secrets.DISCORD_TOKEN }}"

.github/workflows/gitgardian.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Security
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
scanning:
7+
name: GitGuardian scan
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0 # fetch all history so multiple commits can be scanned
14+
- name: GitGuardian scan
15+
uses: GitGuardian/ggshield/actions/secret@v1.23.0
16+
env:
17+
GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
18+
GITHUB_PUSH_BASE_SHA: ${{ github.event.base }}
19+
GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
20+
GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
21+
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}

0 commit comments

Comments
 (0)