Skip to content

Merge pull request #33 from soup-bowl/alpinedocker #22

Merge pull request #33 from soup-bowl/alpinedocker

Merge pull request #33 from soup-bowl/alpinedocker #22

Workflow file for this run

name: Build Container
on:
push:
branches:
- main
- edge
paths:
- "Dockerfile"
- "requirements.txt"
- "htw/**"
- "tests/**"
- ".github/workflows/build.yml"
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Codebase
uses: actions/checkout@v2
- name: Python get
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Run unit tests
run: |
pip install poetry
poetry install
poetry run pytest -v
build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout Codebase
uses: actions/checkout@v2
- name: Login to ghcr.io
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u soup-bowl --password-stdin
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build for Development
if: ${{ github.ref_name == 'edge' }}
uses: docker/build-push-action@v2
with:
push: true
tags: soupbowl/hot-this-week:edge,ghcr.io/soup-bowl/hot-this-week:edge
platforms: linux/amd64,linux/arm64
- name: Build for Production
if: ${{ github.ref_name == 'main' }}
uses: docker/build-push-action@v2
with:
push: true
tags: soupbowl/hot-this-week:latest,ghcr.io/soup-bowl/hot-this-week:latest
platforms: linux/amd64,linux/arm64