-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (43 loc) · 1.4 KB
/
build-backend-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
name: Build Backend Docker Image
on:
push:
branches:
- master
- "backend/"
- "backend/scopeBackend"
pull_request:
branches:
- master
- "backend/"
- "backend/scopeBackend"
# these path settings ensure this workflow only executes on a push
# to this YML itself, or any file in the backend or scopeBackend folders
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# GitHub sets up this token for you
- name: Create db_config.cnf
run: echo "${{ secrets.DB_CONFIG }}" > ./backend/db_config.cnf
- name: Build and push the Docker image
run: docker build -t ghcr.io/${{ github.repository_owner }}/backend:latest ./backend
- name: Push the Docker image
run: docker push ghcr.io/${{ github.repository_owner }}/backend:latest
- name: Delete db_config.cnf
run: rm ./backend/db_config.cnf
# - name: Trigger Hurl Tests Workflow
# uses: peter-evans/repository-dispatch@v2
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# event-type: hurl-tests