-
Notifications
You must be signed in to change notification settings - Fork 50
66 lines (65 loc) · 1.96 KB
/
cd.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: Build release
on:
push:
branches:
- stable
- master
- deploy
- deploy-stg
paths:
- "config/**"
- "lib/**"
- "priv/**"
- "rel/**"
- "test/**"
- "**/*.ex"
- "**/*.exs"
- "mix.lock"
- ".github/workflows/cd.yml"
- "!config/*.example"
jobs:
ci:
name: Build release
runs-on: ubuntu-20.04
env:
MIX_ENV: prod
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ELIXIR_VERSION: 1.13.4
OTP_VERSION: 25.3.2
steps:
- uses: rlespinasse/github-slug-action@v3.x
- uses: actions/checkout@v4
- name: Cache deps
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-
- name: Cache _build
uses: actions/cache@v4
with:
path: |
_build
!_build/prod/cadet-0.0.1.tar.gz
key: cd-${{ env.GITHUB_REF_SLUG }}-${{ runner.os }}-erlang-${{ env.OTP_VERSION }}-elixir-${{ env.ELIXIR_VERSION }}-${{ github.sha }}
restore-keys: |
cd-${{ env.GITHUB_REF_SLUG }}-${{ runner.os }}-erlang-${{ env.OTP_VERSION }}-elixir-${{ env.ELIXIR_VERSION }}-
- name: Setup Elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: ${{ env.ELIXIR_VERSION }}
otp-version: ${{ env.OTP_VERSION }}
- name: mix deps.get
run: |
mix deps.get
- name: mix release
run: mix release --overwrite
- name: Create release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest-${{ env.GITHUB_REF_SLUG }}
prerelease: ${{ env.GITHUB_REF_SLUG == 'master' }}
title: Latest commit on ${{ env.GITHUB_REF_SLUG }}
files: _build/prod/cadet-0.0.1.tar.gz