-
Notifications
You must be signed in to change notification settings - Fork 20
89 lines (78 loc) · 2.4 KB
/
elixir.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: WebUI CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
defaults:
run:
working-directory: web
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.12' # Define the elixir version [required]
otp-version: '24' # Define the OTP version [required]
- name: Restore dependencies cache
uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Run tests
run: mix test
env:
ADMIN_PASS: admin
API_TOKEN: api_admin
SECRET_KEY_BASE: DDyMkkTIcIMVgub9/HtLUyJ/tkJM+4Ls0K/yAO22GFmLTHnStvlDwhv/b+hhOkas
docker-release:
name: Docker Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Version
run: echo "version=$(grep 'version:' mix.exs | cut -d '"' -f2)" >> "$GITHUB_OUTPUT"
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Container Metadata
id: metadata
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository_owner }}/infolab-lights
flavor: |
latest=false
prefix=
suffix=
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=${{ steps.Version.outputs.version }}
- name: Build and Push Container
uses: docker/build-push-action@v4
with:
context: web
file: web/Dockerfile
build-args: |
APP_VSN=${{ steps.Version.outputs.version }}
push: true
platforms: linux/amd64
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max