-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (34 loc) · 1.31 KB
/
build_demo.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
45
46
name: Build Docker image for demo deployment
on:
push:
tags: ['v-*']
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set image tag
run: |
echo "TAG=ghcr.io/internetee/accreditation_center:${{github.ref_name}}" >> $GITHUB_ENV
echo "STATIC_TAG=ghcr.io/internetee/accreditation_center:STATIC_${{github.ref_name}}" >> $GITHUB_ENV
- name: Set files only needed for building
run: |
cp config/database.yml.sample config/database.yml
cp config/application.yml.sample config/application.yml
- name: Build rails image
env:
KEY_BASE: ${{ secrets.KEY_BASE}}
run: |
docker build -t $TAG --build-arg RAILS_ENV=staging --build-arg SECRET_KEY_BASE="$KEY_BASE" -f Dockerfile.generic .
- name: Build static content image
run: |
docker create -ti --name rails $TAG bash
docker cp rails:/opt/webapps/app/public/ ./public/
docker build -t $STATIC_TAG -f Dockerfile.generic-static .
- name: Push Docker images to gh container registry
env:
PASSWORD: ${{ secrets.GHCR }}
run: |
echo $PASSWORD | docker login ghcr.io -u eisbot --password-stdin
docker push $TAG
docker push $STATIC_TAG