Merge pull request #615 from kabalin/kosmosnimki-default #1544
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: | |
- 'master' | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
build-and-push-app: | |
# This only makes sense to run for pastvu owned repo. | |
if: github.repository_owner == 'pastvu' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to ghcr.io | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Build backend | |
- name: Backend metadata | |
id: docker_meta_backend | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.REGISTRY }}/pastvu/backend | |
- name: Build and push backend | |
id: docker_build_backend | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./.docker/backend.Dockerfile | |
tags: ${{ steps.docker_meta_backend.outputs.tags }} | |
labels: ${{ steps.docker_meta_backend.outputs.labels }} | |
push: true | |
# Build frontend | |
- name: Frontend Metadata | |
id: docker_meta_frontend | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.REGISTRY }}/pastvu/frontend | |
- name: Build and push frontend | |
id: docker_build_frontend | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./.docker/frontend.Dockerfile | |
tags: ${{ steps.docker_meta_frontend.outputs.tags }} | |
labels: ${{ steps.docker_meta_frontend.outputs.labels }} | |
push: true | |
- name: Image digest | |
run: | | |
echo ${{ steps.docker_build_backend.outputs.digest }} | |
echo ${{ steps.docker_build_frontend.outputs.digest }} |