Publish dev (Docker image of master) #352
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
# Note: you may want to update this file and deploy-tags.yml at once | |
name: Publish dev (Docker image of master) | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
# deploy master every Saturday at 08:00 UTC | |
- cron: '0 8 * * 6' | |
jobs: | |
push_server: | |
name: Push learn-ocaml image to Docker Hub | |
if: ${{ github.repository == 'ocaml-sf/learn-ocaml' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
# cf. https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#image | |
# and https://docs.docker.com/engine/reference/commandline/buildx_create/#driver | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver: "docker" | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Prepare | |
id: prep | |
run: | | |
echo "::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')" | |
- name: Push to Docker Hub | |
# cf. https://github.com/docker/build-push-action#customizing | |
# and https://github.com/docker/build-push-action/pull/119 | |
uses: docker/build-push-action@v4 | |
with: | |
pull: true | |
push: true | |
tags: "ocamlsf/learn-ocaml:master" | |
labels: | | |
org.opencontainers.image.title=learn-ocaml | |
org.opencontainers.image.description=learn-ocaml app manager | |
org.opencontainers.image.url=https://ocaml-sf.org/ | |
org.opencontainers.image.vendor=The OCaml Software Foundation | |
org.opencontainers.image.created=${{ steps.prep.outputs.created }} | |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | |
org.opencontainers.image.version=master | |
org.opencontainers.image.revision=${{ github.sha }} | |
push_client: | |
name: Push learn-ocaml-client image to Docker Hub | |
if: ${{ github.repository == 'ocaml-sf/learn-ocaml' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
# cf. https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#image | |
# and https://docs.docker.com/engine/reference/commandline/buildx_create/#driver | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver: "docker" | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Prepare | |
id: prep | |
run: | | |
echo "::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')" | |
- name: Push to Docker Hub | |
# cf. https://github.com/docker/build-push-action#customizing | |
# and https://github.com/docker/build-push-action/pull/119 | |
uses: docker/build-push-action@v4 | |
with: | |
pull: true | |
# load: true # implied by "driver: docker" | |
push: true | |
target: client | |
tags: "ocamlsf/learn-ocaml-client:master" | |
labels: | | |
org.opencontainers.image.title=learn-ocaml-client | |
org.opencontainers.image.description=learn-ocaml command-line client | |
org.opencontainers.image.url=https://ocaml-sf.org/ | |
org.opencontainers.image.vendor=The OCaml Software Foundation | |
org.opencontainers.image.created=${{ steps.prep.outputs.created }} | |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | |
org.opencontainers.image.version=master | |
org.opencontainers.image.revision=${{ github.sha }} | |
push_emacs_client: | |
name: Push emacs-learn-ocaml-client image to Docker Hub | |
if: ${{ github.repository == 'ocaml-sf/learn-ocaml' }} | |
needs: push_client | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
# cf. https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#image | |
# and https://docs.docker.com/engine/reference/commandline/buildx_create/#driver | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver: "docker" | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Prepare | |
id: prep | |
run: | | |
echo "::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')" | |
- name: Push to Docker Hub | |
# cf. https://github.com/docker/build-push-action#customizing | |
# and https://github.com/docker/build-push-action/pull/119 | |
uses: docker/build-push-action@v4 | |
with: | |
pull: false # because of the previous "load: true" | |
push: true | |
context: ci/docker-emacs-learn-ocaml-client | |
build-args: | | |
base=ocamlsf/learn-ocaml-client | |
version=master | |
tags: "ocamlsf/emacs-learn-ocaml-client:master" | |
labels: | | |
org.opencontainers.image.title=learn-ocaml-client with emacs | |
org.opencontainers.image.description=learn-ocaml command-line client with emacs | |
org.opencontainers.image.url=https://ocaml-sf.org/ | |
org.opencontainers.image.vendor=The OCaml Software Foundation | |
org.opencontainers.image.created=${{ steps.prep.outputs.created }} | |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | |
org.opencontainers.image.version=master | |
org.opencontainers.image.revision=${{ github.sha }} |