Skip to content

Build

Build #20

Workflow file for this run

name: Build
on:
push:
branches:
- master
pull_request:
schedule:
- cron: "0 4 * * 0"
jobs:
build-boleto-cnab-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
cache-from: type=registry,ref=ghcr.io/build-boleto-cnab-api-latest
cache-to: type=local,dest=/tmp/.buildx-cache
load: true
- name: Install test pre-requisites
run: pip install pytest
- name: Test
run: pytest -v
- name: Push image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
tags: |
ghcr.io/${{ github.repository }}:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=inline
push: true
if: ${{ github.repository_owner == 'akretion' && github.ref == 'refs/heads/master' }}