Skip to content

Publish images

Publish images #839

name: Publish images
on:
pull_request:
branches: [ "master" ]
paths:
- "opencog/**"
- ".github/workflows/**"
push:
branches: [ "master" ]
paths:
- "opencog/**"
- ".github/workflows/**"
schedule:
- cron: "37 2 * * 6" # Run 2:37 AM Saturday night. `man 5 crontab`
workflow_dispatch:
jobs:
# The job is called "base-images".
# The Dockerfile is located in the directory opencog/base
# -- this is the "context"
# The name of the docker image is opencog/opencog-deps:latest
base-images:
runs-on: ubuntu-22.04
steps:
- name: Checkout current repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push opencog-deps to docker hub
uses: docker/build-push-action@v6
with:
context: opencog/base
tags: ${{ secrets.DOCKER_NAMESPACE }}/opencog-deps:latest
push: true
# Needs is the name of the job, above.
atomspace:
needs: base-images
runs-on: ubuntu-22.04
steps:
- name: Checkout current repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push to docker hub
uses: docker/build-push-action@v6
with:
context: opencog/${{ github.job }}
tags: ${{ secrets.DOCKER_NAMESPACE }}/${{ github.job }}:latest
push: true
learn:
needs: atomspace
runs-on: ubuntu-22.04
steps:
- name: Checkout current repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push to docker hub
uses: docker/build-push-action@v6
with:
context: opencog/${{ github.job }}
tags: ${{ secrets.DOCKER_NAMESPACE }}/${{ github.job }}:latest
push: true
# TODO: Create dockerfile & publish an as-moses image.
# as-moses:
# needs: atomspace
# runs-on: ubuntu-22.04
# steps:
# - name: Checkout current repo
# uses: actions/checkout@v4
#
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
#
# - name: Login to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
#
# - name: Build and push to docker hub
# uses: docker/build-push-action@v6
# with:
# XXX wrong context, fixme.
# context: archive/${{ github.job }}
# tags: ${{ secrets.DOCKER_NAMESPACE }}/${{ github.job }}:latest
# push: true