Add pull request CI

This commit is contained in:
Pau Rodriguez-Estivill
2022-02-26 15:31:57 +01:00
parent 8dedbc0a64
commit 5bb70f851b
+10 -12
View File
@@ -1,9 +1,11 @@
name: CI
on: push
on:
push:
pull_request:
jobs:
test:
test-script:
runs-on: ubuntu-latest
services:
postgres:
@@ -46,35 +48,31 @@ jobs:
mkdir -p "$BACKUP_DIR"
sh -xe backup.sh
build:
test-docker:
if: ${{ github.event_name == 'pull_request' || github.ref != 'refs/heads/main' }}
needs: [ test-script ]
runs-on: ubuntu-latest
if: ${{ github.ref != 'refs/heads/main' }}
needs: [ test ]
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: amd64,arm64,arm/v7,s390x,ppc64le
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build images
- name: Test docker images build
run: docker buildx bake --pull
publish:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
needs: [ test-script ]
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs: [ test ]
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: amd64,arm64,arm/v7,s390x,ppc64le
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1