Skip to content

User defined http error for loader #215

User defined http error for loader

User defined http error for loader #215

Workflow file for this run

name: ci
on:
push:
branches:
- '**'
tags:
- '!v**'
release:
types:
- published
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Build a dev image
id: docker_build_dev
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile.dev
push: false
load: true
tags: transformimgs-dev
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
-
name: Run tests
run: |
docker run --entrypoint=/go/src/github.com/Pixboost/transformimgs/test.sh -v $(pwd):/go/src/github.com/Pixboost/transformimgs transformimgs-dev
-
name: Code coverage
run: |
bash <(curl -s https://codecov.io/bash)
-
name: Build a prod image
id: docker_build_prod
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: false
load: true
tags: transformimgs
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
-
name: Run the service
run: |
docker run -p 8080:8080 -d transformimgs
sleep 5
-
name: Smoketest
run: |
curl -o /dev/null -f http://localhost:8080/img/https://pixboost.com/img/homepage/hero.jpg/resize?size=x600
-
name: Publish image
if: ${{ github.event_name == 'release' }}
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
load: false
tags: pixboost/transformimgs:${{ github.event.release.tag_name }},pixboost/transformimgs:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache