-
Notifications
You must be signed in to change notification settings - Fork 5
53 lines (45 loc) · 1.56 KB
/
dockerpublish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Docker
on:
push:
# Publish `main` as Docker `latest` image.
branches:
- main
# Publish `v1.2.3` tags as releases.
tags:
- v*
env:
REGISTRY: ghcr.io
BACKEND_IMAGE_NAME: demo-invenioils-backend
FRONTEND_IMAGE_NAME: demo-invenioils-frontend
jobs:
build-push:
name: Publish images
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish backend image
uses: docker/build-push-action@v3
with:
context: ./demo-invenioils/
file: ./demo-invenioils/docker/backend/Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.BACKEND_IMAGE_NAME }}:latest
- name: Build and publish frontend image
uses: docker/build-push-action@v3
with:
context: ./demo-invenioils/
file: ./demo-invenioils/docker/frontend/Dockerfile
build-args: |
BACKEND_BUILT_IMAGE_URL=${{ env.REGISTRY }}/${{ github.repository }}/${{ env.BACKEND_IMAGE_NAME }}:latest
ENV_NAME=prod
INVENIO_UI_URL=https://invenioils.web.cern.ch
INVENIO_REST_ENDPOINTS_BASE_URL=https://invenioils.web.cern.ch/api
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.FRONTEND_IMAGE_NAME }}:latest