chore: tweak Makefile file path archive (#7) #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR | |
on: | |
push: | |
branches: | |
- master | |
- main | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
ci: | |
name: CI | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
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 | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: | |
override: true | |
components: rustfmt, clippy | |
- name: Formatting check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Lint check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --workspace -- -D warnings | |
- name: Run test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --workspace --no-fail-fast | |
cd: | |
name: CD | |
needs: | |
- ci | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
flavor: | | |
latest=false | |
tags: | | |
type=edge | |
type=sha | |
- 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 }} |