Publish on push and also on pull req #819
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
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@v5 | |
with: | |
context: opencog/base | |
tags: ${{ secrets.DOCKER_NAMESPACE }}/opencog-deps:latest | |
push: true | |
- name: Build and push atomspace to docker hub | |
uses: docker/build-push-action@v5 | |
with: | |
context: opencog/atomspace | |
tags: ${{ secrets.DOCKER_NAMESPACE }}/atomspace:latest | |
push: true | |
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@v5 | |
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@v5 | |
with: | |
context: opencog/${{ github.job }} | |
tags: ${{ secrets.DOCKER_NAMESPACE }}/${{ github.job }}:latest | |
push: true | |
# TODO: publish an as-moses image. | |
# Obsolete. Stop publishing this. | |
# opencog-dev: | |
# 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@v5 | |
# with: | |
# context: archive/tools/cli | |
# tags: | | |
# ${{ secrets.DOCKER_NAMESPACE }}/${{ github.job }}:cli | |
# ${{ secrets.DOCKER_NAMESPACE }}/${{ github.job }}:latest | |
# push: true | |
# | |
# moses has been replaced by as-moses, in the opencog-dev package. | |
# relex is just plain-old obsolete. | |
# moses: | |
# 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@v5 | |
# with: | |
# context: archive/${{ github.job }} | |
# tags: ${{ secrets.DOCKER_NAMESPACE }}/${{ github.job }}:latest | |
# push: true | |
# | |
# relex: | |
# runs-on: ubuntu-20.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@v5 | |
# with: | |
# context: archive/${{ github.job }} | |
# tags: ${{ secrets.DOCKER_NAMESPACE }}/${{ github.job }}:latest | |
# push: true |