diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5b14a6..981efc3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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