-
Notifications
You must be signed in to change notification settings - Fork 66
134 lines (134 loc) · 5.7 KB
/
deploy-master.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# 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 }}