Skip to content

Fix 500 error on API DELETE endpoints #48

Fix 500 error on API DELETE endpoints

Fix 500 error on API DELETE endpoints #48

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
test:
name: Test Elixir ${{ matrix.version }}
runs-on: ubuntu-latest
container: elixir:${{ matrix.version }}-alpine
strategy:
matrix:
include:
- version: "1.14"
services:
postgres:
image: postgres:13-alpine
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
MIX_ENV: test
DB_URL: postgres://postgres:postgres@postgres/keila
steps:
- name: install system packages
run: apk add build-base git tar
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
_build
deps
assets/node_modules
key: keila-${{ runner.os }}-elixir-${{ matrix.version }}-${{ hashFiles('mix.lock') }}
- name: mix deps.get
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: mix format --check-formatted
run: mix format --check-formatted
- name: mix ecto.create && ecto.migrate
run: |
mix ecto.create
mix ecto.migrate
- name: mix test
run: mix test
build:
name: Build and Release
needs:
- test
runs-on: ubuntu-latest
environment: build
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- id: meta
run: |
VERSION=`echo ${{ github.ref }} | grep -oE "([0-9]+)\.([0-9]+)\.([0-9]+)"`
MINOR_VERSION=`echo $VERSION | grep -oE "^([0-9]+)\.([0-9]+)"`
MAJOR_VERSION=`echo $VERSION | grep -oE "^([0-9]+)"`
echo "::set-output name=version::${VERSION}"
echo "::set-output name=minor_version::${MINOR_VERSION}"
echo "::set-output name=major_version::${MAJOR_VERSION}"
awk -v version="${VERSION}" '/## Version\s/ {printit = $3 == version}; printit;' "$2" CHANGELOG.md > __CHANGELOG__.md
cat __CHANGELOG__.md
- uses: docker/build-push-action@v3
with:
context: .
file: ./ops/Dockerfile
tags: |
pentacent/keila:latest
pentacent/keila:${{ steps.meta.outputs.version }}
pentacent/keila:${{ steps.meta.outputs.major_version }}
pentacent/keila:${{ steps.meta.outputs.minor_version }}
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.meta.outputs.version }}
body_path: __CHANGELOG__.md
release_name: Keila v${{ steps.meta.outputs.version }}
draft: false
prerelease: false