Only build public images on merge
This commit is contained in:
32
.github/workflows/build-docker-images.yml
vendored
Normal file
32
.github/workflows/build-docker-images.yml
vendored
Normal file
@ -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}
|
||||
20
.github/workflows/run-tests.yaml
vendored
20
.github/workflows/run-tests.yaml
vendored
@ -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 .'
|
||||
|
||||
Reference in New Issue
Block a user