Skip to content

Also push docker images to GCR (#374) #450

Also push docker images to GCR (#374)

Also push docker images to GCR (#374) #450

Workflow file for this run

name: CI
on: push
jobs:
test:
runs-on: ubuntu-22.04
services:
db:
image: postgres:10
env:
POSTGRES_DB: accent_test
POSTGRES_PASSWORD: password
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
MIX_ENV: test
DATABASE_URL: postgres://postgres:password@localhost/accent_test
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: erlef/setup-elixir@v1
with:
otp-version: 25.0.2
elixir-version: 1.14.x
- uses: actions/setup-node@v3
with:
node-version: 16.13.x
cache: 'npm'
- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc libyaml-dev
- name: Install Elixir Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
mix deps.compile
- name: Install NodeJS Dependencies
run: |
npm config set spin false
npm ci --no-audit --no-color
npm ci --prefix webapp --no-audit --no-color
npm ci --prefix cli --no-audit --no-color
npm ci --prefix jipt --no-audit --no-color
- name: Build webapp production
run: npm run build-production-inline --prefix webapp
- name: Run Tests
run: |
mix ecto.setup
./priv/scripts/ci-check.sh
- name: Build CLI
run: npm --prefix cli run build
- name: Build JIPT
run: npm --prefix jipt run build-production-inline
- name: Coverage report
run: mix coveralls.post --token ${{ secrets.COVERALLS_REPO_TOKEN }} --name 'github-actions' --branch ${{ github.ref }} --committer ${{ github.actor }} --sha ${{ github.sha }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
mirego/accent
ghcr.io/mirego/accent
tags: |
type=semver,pattern={{raw}}
- uses: docker/build-push-action@v5
with:
context: .
push: ${{ startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}