Skip to content

Commit

Permalink
fix up CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartjohnpage committed Mar 7, 2024
1 parent f33484c commit f7d4add
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy
on:
release:
types: [published]

jobs:
build:
name: test and deploy
runs-on: ubuntu-22.04
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
MIX_ENV: prod
strategy:
matrix:
otp: ["25.2"]
elixir: ["1.15.6"]
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Restore dependencies cache
uses: actions/cache@v3
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
- name: Deploy package
run: mix hex.publish --yes

8 changes: 3 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: Test
on:
push:

branches:
- main
permissions:
contents: read

jobs:
build:
name: test and deploy
name: test
runs-on: ubuntu-22.04
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
Expand All @@ -32,7 +33,4 @@ jobs:
run: mix deps.get
- name: Run tests
run: mix test
- name: Deploy package
if: ${{ github.ref == 'refs/heads/main' }}
run: mix hex.publish --yes

0 comments on commit f7d4add

Please sign in to comment.