Skip to content

PUBLISH to GitHub Container Registry #10

PUBLISH to GitHub Container Registry

PUBLISH to GitHub Container Registry #10

Workflow file for this run

name: Build and Push Docker Containers to GitHub Container Registry
on: [pull_request]
env:
REGISTRY: ghcr.io
IMAGE_NAME: quantecon/lecture-python.docker
TAG: cuda-12.3.1-anaconda-2024-02-py311
jobs:
push_to_registry:
name: Push Docker image to GitHub Containers
permissions:
packages: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Create more disk space on Ubuntu
run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Build image
run: |
cd ${{ env.TAG }}
docker build . --file Dockerfile --tag ${{ env.IMAGE_NAME }} --label ${{ env.TAG }}
- name: Log in to registr y
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build & Push Container
run: |
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$TAG