This commit is contained in:
18
.github/workflows/docker.yaml
vendored
Normal file
18
.github/workflows/docker.yaml
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
name: Docker build
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
- name: Build the Docker image
|
||||
run: docker buildx build -t ghcr.io/${{ github.repository_owner }}/snort:latest --platform linux/amd64,linux/arm64 --push .
|
18
.github/workflows/eslint.yaml
vendored
Normal file
18
.github/workflows/eslint.yaml
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
name: Linting
|
||||
on:
|
||||
pull_request:
|
||||
jobs:
|
||||
formatting:
|
||||
timeout-minutes: 15
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install Dependencies
|
||||
run: yarn install
|
||||
- name: Check Eslint
|
||||
run: yarn eslint
|
18
.github/workflows/formatting.yaml
vendored
Normal file
18
.github/workflows/formatting.yaml
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
name: Formatting
|
||||
on:
|
||||
pull_request:
|
||||
jobs:
|
||||
formatting:
|
||||
timeout-minutes: 15
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install Dependencies
|
||||
run: yarn install
|
||||
- name: Check Formatting
|
||||
run: yarn prettier --check .
|
37
.github/workflows/tagged.yml
vendored
Normal file
37
.github/workflows/tagged.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
name: Docker build on tag
|
||||
env:
|
||||
DOCKER_CLI_EXPERIMENTAL: enabled
|
||||
TAG_FMT: "^refs/tags/(((.?[0-9]+){3,4}))$"
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v[0-9]+.[0-9]+.[0-9]+
|
||||
- v[0-9]+.[0-9]+.[0-9]+-*
|
||||
jobs:
|
||||
build:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Set env variables
|
||||
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
- uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
- name: Build the Docker image
|
||||
run: |
|
||||
docker buildx build \
|
||||
-t ghcr.io/${{ github.repository_owner }}/snort:$TAG \
|
||||
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
||||
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
--push .
|
Reference in New Issue
Block a user