diff --git a/.github/workflows/build-docker-images.yml b/.github/workflows/build-docker-images.yml new file mode 100644 index 000000000..4da34f1a2 --- /dev/null +++ b/.github/workflows/build-docker-images.yml @@ -0,0 +1,32 @@ +name: Run tests +on: + push: + branches: + - main + paths-ignore: + - 'apple/**' + - 'android/**' + +jobs: + build-docker-images: + name: Build docker images + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: 'Login to GitHub container registry' + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{github.actor}} + password: ${{secrets.GITHUB_TOKEN}} + - name: Build the backend docker image + run: | + docker build . --file packages/api/Dockerfile --tag "ghcr.io/omnivore-app/backend:${GITHUB_SHA}" --tag ghcr.io/omnivore-app/backend:latest + docker push ghcr.io/omnivore-app/backend:${GITHUB_SHA} + - name: Build the content-fetch docker image + run: | + docker build --file packages/content-fetch/Dockerfile . --tag "ghcr.io/omnivore-app/content-fetch:${GITHUB_SHA}" --tag ghcr.io/omnivore-app/content-fetch:latest + docker push ghcr.io/omnivore-app/content-fetch:${GITHUB_SHA} diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 249f92204..3b31fd7b9 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -5,11 +5,13 @@ on: - main paths-ignore: - 'apple/**' + - 'android/**' pull_request: branches: - main paths-ignore: - 'apple/**' + - 'android/**' env: NEXT_PUBLIC_APP_ENV: prod @@ -111,11 +113,25 @@ jobs: - name: Build the API docker image # run: 'docker build --file packages/api/Dockerfile .' run: | - docker build . --file packages/api/Dockerfile --tag ghcr.io/omnivore-app/backend:latest - docker push ghcr.io/omnivore-app/backend:latest + docker build . --file packages/api/Dockerfile --tag "ghcr.io/omnivore-app/backend:${GITHUB_SHA}" --tag ghcr.io/omnivore-app/backend:latest + docker push ghcr.io/omnivore-app/backend:${GITHUB_SHA} - name: Build the content-fetch docker image run: 'docker build --file packages/content-fetch/Dockerfile .' - name: Build the inbound-email-handler docker image run: 'docker build --file packages/inbound-email-handler/Dockerfile .' - name: Build the content-fetch cloud function docker image run: 'docker build --file packages/content-fetch/Dockerfile-gcf .' +build-docker-images: + name: Build docker images + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Build the API docker image + run: 'docker build --file packages/api/Dockerfile .' + - name: Build the content-fetch cloud function docker image + run: 'docker build --file packages/content-fetch/Dockerfile-gcf .' + - name: Build the inbound-email-handler docker image + run: 'docker build --file packages/inbound-email-handler/Dockerfile .'