Skip to content

Adopt project linters #48

Adopt project linters

Adopt project linters #48

Workflow file for this run

name: CI
on:
push:
branches: [main]
paths-ignore:
- ".gitignore"
- "LICENSE.md"
- "README.md"
pull_request:
branches: [main]
paths-ignore:
- ".gitignore"
- "LICENSE.md"
- "README.md"
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version: '22.11.0'
- name: Lint Dockerfiles
run: |
wget -O hadolint https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64
mv hadolint /usr/local/bin/hadolint
chmod +x /usr/local/bin/hadolint
hadolint --config .hadolint.yaml Dockerfiles/*
- name: Lint Dockerfiles
run: |
wget -O hadolint https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64
mv hadolint /usr/local/bin/hadolint
chmod +x /usr/local/bin/hadolint
hadolint --config .hadolint.yaml Dockerfiles/*
- name: Lint JS
run: |
cd src/
npm i
npx eslint .
build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./Dockerfiles/Dockerfile.drgon-postgres
image: ghcr.io/${{ github.repository }}
tag: postgres
- dockerfile: ./Dockerfiles/Dockerfile.drgon-server
image: ghcr.io/${{ github.repository }}
tag: server
permissions:
packages: write
steps:
- uses: actions/checkout@v2
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=sha,prefix=${{ matrix.tag }}-
type=raw,value=${{ matrix.tag }}
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: geovanni-bot
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.docker_meta.outputs.tags }}