Skip to content

Commit

Permalink
Add pull request CI
Browse files Browse the repository at this point in the history
  • Loading branch information
prodrigestivill committed Feb 26, 2022
1 parent 8dedbc0 commit 5bb70f8
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: CI

on: push
on:
push:
pull_request:

jobs:
test:
test-script:
runs-on: ubuntu-latest
services:
postgres:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5bb70f8

Please sign in to comment.