53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
name: Build and test
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
docker:
|
|
name: Build Docker image
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v3
|
|
with:
|
|
images: ghcr.io/RetroPilot/retropilot-server
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=ref,event=pr
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
type=sha
|
|
- name: Login to GHCR
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
# lint:
|
|
# name: Run linter
|
|
# runs-on: ubuntu-20.04
|
|
# needs: docker
|
|
# steps:
|
|
# - name: Run linter
|
|
# run: docker run --rm retropilot-server:latest npm run lint
|
|
|
|
# test:
|
|
# name: Run tests
|
|
# runs-on: ubuntu-20.04
|
|
# needs: docker
|
|
# steps:
|
|
# - name: Run tests
|
|
# run: docker run --rm --env-file .env.sample -v /tmp/realdata:/app/realdata retropilot-server:latest npm test
|