Skip to content

Commit

Permalink
Build assets on CI (#3552)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko authored Dec 13, 2024
1 parent f01497f commit 3b61f4b
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Assets

on:
push:
branches:
- main
- "v*.*"

jobs:
build:
runs-on: ubuntu-22.04
env:
elixir: 1.17.2
otp: 27.0
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ env.elixir }}
otp-version: ${{ env.otp }}

- name: Restore deps and _build cache
uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}-${{ hashFiles('**/mix.lock') }}-dev
restore-keys: |
${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}-
- name: Install Dependencies
run: mix deps.get --only dev

- name: Set up Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Restore npm cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install npm dependencies
run: npm ci --prefix assets

- name: Build assets
run: mix assets.build

- name: Push updated assets
id: push_assets
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update assets
file_pattern: priv/static

0 comments on commit 3b61f4b

Please sign in to comment.