-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (54 loc) · 2.17 KB
/
docker-private_api_dev.yml
File metadata and controls
66 lines (54 loc) · 2.17 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Private API Development
on:
push:
branches: [ "Development" ]
paths:
- back/private/**
jobs:
build:
runs-on: ubuntu-latest
environment: Development
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@v4
# ---- Replace secrets safely using jq (special characters) ----
- name: Replace secrets in appsettings
working-directory: back/
run: |
jq \
--arg mongo "$MONGODB_CONNSTRING" \
--arg duser "$DREMIO_USER" \
--arg dpwd "$DREMIO_PWD" \
--arg dserver "$DREMIO_SERVER" \
--arg dauth "$DREMIO_SERVER_AUTH" \
'.MongoSettings.ConnectionString = $mongo |
.DremioSettings.Username = $duser |
.DremioSettings.Password = $dpwd |
.DremioSettings.DremioServer = $dserver |
.DremioSettings.DremioServerAuth = $dauth' \
Configs/appsettings_dev.json > Configs/appsettings_dev.tmp.json && \
mv Configs/appsettings_dev.tmp.json Configs/appsettings_dev.json
env:
MONGODB_CONNSTRING: ${{ secrets.MONGODB_CONNSTRING }}
DREMIO_USER: ${{ secrets.DREMIO_USER }}
DREMIO_PWD: ${{ secrets.DREMIO_PWD }}
DREMIO_SERVER: ${{ secrets.DREMIO_SERVER }}
DREMIO_SERVER_AUTH: ${{ secrets.DREMIO_SERVER_AUTH }}
- name: Build the Docker image
working-directory: back/
run: docker build -f private/Dockerfile --build-arg ENVIRONMENT=dev -t txalaparta/discodata-private_api_dev:latest .
- uses: docker/login-action@v3
name: Login to Docker Hub
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: actions/checkout@v4
- name: Push Docker image
working-directory: back/private
run: docker push txalaparta/discodata-private_api_dev:latest
- uses: actions/checkout@v4
- name: Remove the Docker image to free space
working-directory: back
run: docker image rmi -f txalaparta/discodata-private_api_dev:latest