forked from openfoodfacts/openfoodfacts-server
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (42 loc) · 1.52 KB
/
containerimage.yml
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
name: Container Image CI
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Publish frontend image to Registry
uses: elgohr/[email protected]
with:
name: ${{ github.repository }}/frontend
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
dockerfile: docker/frontend/Dockerfile
snapshot: true
id: publish_frontend
- name: Copy frontend output for backend container
run: |
CONTAINER=$(docker create docker.pkg.github.com/${{ github.repository }}/frontend:${{ steps.publish_frontend.outputs.snapshot-tag }})
docker cp $CONTAINER:/opt/product-opener/html/images/icons/dist - > icons.tar
docker cp $CONTAINER:/opt/product-opener/html/js/dist - > js.tar
docker cp $CONTAINER:/opt/product-opener/html/css/dist - > css.tar
tar -xf icons.tar -C ./html/images/icons/
tar -xf js.tar -C ./html/js/
tar -xf css.tar -C ./html/css/
rm icons.tar js.tar css.tar
docker rm -v $CONTAINER
- name: Publish backend image to Registry
uses: elgohr/[email protected]
with:
name: ${{ github.repository }}/backend
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
dockerfile: docker/backend/Dockerfile
snapshot: true