-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.2 KB
/
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
name: Docker Image CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Decode secrets
env:
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
DOCKER_URL_IMAGE_TO_PUSH: ${{secrets.DOCKER_URL_IMAGE_TO_PUSH}}
DOCKER_USER: ${{secrets.DOCKER_USER}}
ENVS_JSON: ${{secrets.ENVS_JSON}}
SQLITE_DUMP: ${{secrets.SQLITE_DUMP}}
run: |
echo "$ENVS_JSON" | base64 -d > envs.json
echo "$SQLITE_DUMP" | base64 -d > database.sqlite
- name: Docker login and build
env:
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
DOCKER_URL_IMAGE_TO_PUSH: ${{secrets.DOCKER_URL_IMAGE_TO_PUSH}}
DOCKER_USER: ${{secrets.DOCKER_USER}}
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
docker build . --file Dockerfile --tag $DOCKER_URL_IMAGE_TO_PUSH
- name: Docker push
env:
DOCKER_URL_IMAGE_TO_PUSH: ${{secrets.DOCKER_URL_IMAGE_TO_PUSH}}
run: |
docker push $DOCKER_URL_IMAGE_TO_PUSH