Skip to content

RL Toolkit v5.0.0

RL Toolkit v5.0.0 #13

Workflow file for this run

name: Python CI (publishing)
on:
release:
types: [published]
jobs:
deploy-pkg:
name: Deploy package
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish package
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
deploy-img:
name: Deploy image
needs: deploy-pkg
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Setup Buildx
uses: docker/[email protected]
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/[email protected]
with:
context: ./
file: ./docker/Dockerfile
push: true
platforms: linux/amd64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
tags: |
docker.io/${{ secrets.DOCKER_USERNAME }}/rl-toolkit:latest
ghcr.io/${{ github.repository_owner }}/rl-toolkit:latest
labels: |
org.opencontainers.image.title=${{ github.event.repository.name }}
org.opencontainers.image.description=${{ github.event.repository.description }}
org.opencontainers.image.url=${{ github.event.repository.html_url }}
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
# org.opencontainers.image.version=${{ steps.tags.outputs.version }}
# org.opencontainers.image.created=${{ steps.tags.outputs.build_date }}
# Temporary cache 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