Skip to content

Dockerhub

Dockerhub #43

Workflow file for this run

name: Dockerhub
env:
docker_repo: robpc/godot-export-action
latest: '4.1.1'
on:
workflow_run:
workflows:
- Test
types:
- completed
jobs:
docker:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
strategy:
matrix:
version:
- '4.1.1'
exports:
- linux
- macos
- win32
- win64
- windows
- desktop
- android
- ios
- mobile
- web
- all
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: docker-${{ matrix.version }}-${{ matrix.exports }}-${{ github.sha }}
restore-keys: |
docker-${{ matrix.version }}-${{ matrix.exports }}
docker-${{ matrix.version }}
docker-
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set Docker Tags
env:
repo: ${{ env.docker_repo }}
latest: ${{ env.latest }}
version: ${{ matrix.version }}
exports: ${{ matrix.exports }}
run: |
docker_tags="${repo}:${version}-${exports}"
if [ "$exports" = "all" ]; then
docker_tags="${docker_tags},${repo}:${version}"
if [ "$version" = "$latest" ]; then
docker_tags="${docker_tags},${repo}:latest"
fi
fi
echo "docker_tags=${docker_tags}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ env.docker_tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
build-args: |
GODOT_VERSION=${{ matrix.version }}
EXPORT_TEMPLATES=${{ matrix.exports }}
- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache