Skip to content

refactor: remove obsolete gdxml subdir and dependency (#286) #129

refactor: remove obsolete gdxml subdir and dependency (#286)

refactor: remove obsolete gdxml subdir and dependency (#286) #129

Workflow file for this run

name: Build Push Image
on:
push:
branches:
- main
- test
jobs:
build-push:
runs-on: [gpu]
strategy:
matrix:
target: [release, develop]
steps:
- name: Define environment variables
run: |
echo IMAGE_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo IMAGE_TAG=$(echo ${{ matrix.target }}) >> $GITHUB_ENV
if [ "${{ matrix.target }}" = "release" ]; then
echo IMAGE_TAG=latest >> $GITHUB_ENV
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push to registries
uses: docker/build-push-action@v6
with:
push: true
tags: |
ghcr.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
docker.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
target: ${{ matrix.target }}
cache-from: type=local,src=/home/runner/.buildx-cache
cache-to: type=local,dest=/home/runner/.buildx-cache-new,mode=max
- name: Move cache
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
run: |
rm -rf /home/runner/.buildx-cache
mv /home/runner/.buildx-cache-new /home/runner/.buildx-cache
cleanup:
runs-on: ubuntu-latest
needs: build-push
steps:
- uses: dataaxiom/ghcr-cleanup-action@v1