Skip to content

Generate placeholder image for every mediaitem #198

Generate placeholder image for every mediaitem

Generate placeholder image for every mediaitem #198

Workflow file for this run

name: Smriti API CI
on:
push:
branches:
- master
paths:
- api/**
pull_request:
branches:
- master
paths:
- api/**
release:
types: [published]
jobs:
ci:
name: Integration Check
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./api
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: '^1.20'
- name: Go Version
run: go version
- name: Run Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54.0
working-directory: api
- name: Run Build
run: make build
- name: Run Test & Cover
run: make cover
- name: Publish Coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: api
files: api/coverage.txt
publish:
if: ${{ (github.event_name == 'release' && github.event.action == 'published') || github.ref == 'refs/heads/master' }}
needs: ci
name: Publish Docker Image
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./api
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: Docker Login
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Build
run: docker build . --build-arg GITSHA=${GITHUB_SHA} --build-arg VERSION=${GITHUB_REF_NAME} --file Dockerfile --tag smritihq/api:${GITHUB_REF_NAME}
- name: Docker Publish
run: docker push smritihq/api:${GITHUB_REF_NAME}