-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (59 loc) · 2.2 KB
/
kdetosakra_docker_image.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Deploy kdetosakra CI
on:
push:
branches: [ "master" ]
paths:
- "src/**"
- "public/**"
- "server/**"
- "*.{js,json,sh}"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Declare some variables
id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Build the Docker image
env:
API_KEY: ${{secrets.API_KEY}}
FIREBASE_MEASUREMENT_ID: ${{secrets.FIREBASE_MEASUREMENT_ID}}
FIREBASE_APP_ID: ${{secrets.FIREBASE_APP_ID}}
FIREBASE_MESSAGING_SENDER_ID: ${{secrets.FIREBASE_MESSAGING_SENDER_ID}}
FIREBASE_STORAGE_BUCKET: ${{secrets.FIREBASE_STORAGE_BUCKET}}
FIREBASE_PROJECT_ID: ${{secrets.FIREBASE_PROJECT_ID}}
FIREBASE_AUTH_DOMAIN: ${{secrets.FIREBASE_AUTH_DOMAIN}}
FIREBASE_API_KEY: ${{secrets.FIREBASE_API_KEY}}
SENTRY_DNS: ${{secrets.SENTRY_DNS}}
WEB_URL: ${{secrets.WEB_URL}}
run: |
docker build \
--file Dockerfile \
--build-arg API_KEY=$API_KEY \
--build-arg FIREBASE_MEASUREMENT_ID=$FIREBASE_MEASUREMENT_ID \
--build-arg FIREBASE_APP_ID=$FIREBASE_APP_ID \
--build-arg FIREBASE_MESSAGING_SENDER_ID=$FIREBASE_MESSAGING_SENDER_ID \
--build-arg FIREBASE_STORAGE_BUCKET=$FIREBASE_STORAGE_BUCKET \
--build-arg FIREBASE_PROJECT_ID=$FIREBASE_PROJECT_ID \
--build-arg FIREBASE_AUTH_DOMAIN=$FIREBASE_AUTH_DOMAIN \
--build-arg FIREBASE_API_KEY=$FIREBASE_API_KEY \
--build-arg SENTRY_DNS=$SENTRY_DNS \
--build-arg WEB_URL=$WEB_URL \
--tag bouchja1/kdetosakra:${{ steps.vars.outputs.sha_short }} \
--tag bouchja1/kdetosakra:latest \
.
- name: Docker push
run: |
docker push bouchja1/kdetosakra:${{ steps.vars.outputs.sha_short }}
docker push bouchja1/kdetosakra:latest