Skip to content

docker: Actually install dependencies #47

docker: Actually install dependencies

docker: Actually install dependencies #47

Workflow file for this run

name: Azafea Metrics Proxy Tests
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
build:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker Image
run: docker build --tag amp .
- name: Save Docker Image
run: docker save amp > docker-image.tar
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: image
path: docker-image.tar
tests:
name: Integration Tests
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get Docker Image
uses: actions/download-artifact@v4
with:
name: image
- name: Load Docker Image
run: docker load < docker-image.tar
- name: Install Docker Images
run: docker run -d --name=redis --network=host redis:5-alpine --requirepass 'CHANGE ME!!'
- name: Run Tests
run: docker run --rm --network=host --entrypoint="" amp pipenv run test-all
- name: Remove Docker Images
run: docker rm -f redis
lint:
name: Lint and Type Checking
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get Docker Image
uses: actions/download-artifact@v4
with:
name: image
- name: Load Docker Image
run: docker load < docker-image.tar
- name: Lint
run: docker run --rm --entrypoint="" amp pipenv run lint
- name: Type Checking
run: docker run --rm --entrypoint="" amp pipenv run type-check
push:
name: Upload the Docker image to Docker Hub
runs-on: ubuntu-latest
# We only want to publish a new image when the master branch changes, not
# for PRs and only if tests finish successfully.
needs: tests
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: '${{ secrets.DOCKERHUB_USERNAME }}'
password: '${{ secrets.DOCKERHUB_TOKEN }}'
- name: Get Docker Image
uses: actions/download-artifact@v4
with:
name: image
- name: Load Docker Image
run: docker load < docker-image.tar
- name: Upload the image
run: |
docker tag amp endlessm/azafea-metrics-proxy:latest
docker push endlessm/azafea-metrics-proxy:latest