Skip to content

More pages, store hashes #62

More pages, store hashes

More pages, store hashes #62

Workflow file for this run

on:
push:
branches:
- main
jobs:
ci:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_APP_IMAGE_NAME: "ghcr.io/whiletrue-industries/odds/odds-server"
run: |
echo "${GITHUB_TOKEN}" | docker login ghcr.io -u whiletrue-industries --password-stdin &&\
if docker pull "${DOCKER_APP_IMAGE_NAME}:latest"; then
CACHE_FROM_ARG="--cache-from ${DOCKER_APP_IMAGE_NAME}:latest"
else
CACHE_FROM_ARG=""
fi &&\
docker build $CACHE_FROM_ARG --build-arg VERSION=${GITHUB_SHA} -t app -f docker/api-server/Dockerfile . &&\
docker tag app "${DOCKER_APP_IMAGE_NAME}:${GITHUB_SHA}" &&\
docker push "${DOCKER_APP_IMAGE_NAME}:${GITHUB_SHA}" &&\
if [ "${GITHUB_REF}" == "refs/heads/main" ]; then
docker tag app "${DOCKER_APP_IMAGE_NAME}:latest" &&\
docker push "${DOCKER_APP_IMAGE_NAME}:latest"
fi