-
Notifications
You must be signed in to change notification settings - Fork 25
81 lines (79 loc) · 3.35 KB
/
deploy_docker.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
name: Build Docker Image
on:
repository_dispatch:
types: [pypip-deployed]
jobs:
deploy:
runs-on: ubuntu-latest
name: "Deploy image on Dockerhub"
steps:
- name: Check out
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: '${{ github.event.client_payload.ref }}'
token: '${{ secrets.PERSONAL_ACCESS_TOKEN }}'
- run: echo ${{ github.event.client_payload.ref }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get smart tag
id: prepare
uses: jupyter-naas/docker-smart-tag-action@1.0.0
with:
ref: ${{ github.event.client_payload.ref }}
docker_image: jupyternaas/naas
- run: echo ${{ steps.prepare.outputs.tag }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.prepare.outputs.tag }}
context: .
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
- uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
text: ${{ steps.get-latest-tag.outputs.tag }}
regex: '^\d*\.\d*\.\d*$'
- name: Checkout Target Repository
if: ${{ steps.regex-match.outputs.match != '' }}
uses: actions/checkout@v2
with:
repository: CashStory/cs_confs
path: cs_confs
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Update Image Version in the related HelmChart values.yaml
if: ${{ steps.regex-match.outputs.match != '' }}
uses: fjogeleit/yaml-update-action@master
with:
valueFile: 'galaxy/tools/jupyter/values.yaml'
propertyPath: 'jupyter.dockerNotebookImage'
value: 'jupyternaas/naas:${{ steps.get-latest-tag.outputs.tag }}'
repository: 'CashStory/cs_confs'
branch: main
createPR: 'false'
message: 'Bump: Naas Version to ${{ steps.get-latest-tag.outputs.tag }}'
token: '${{ secrets.PERSONAL_ACCESS_TOKEN }}'
workDir: cs_confs
- name: Image digest
run: echo ${{ steps.prepare.outputs.tag }}
- name: Get the last version change
id: lastchanges
uses: jupyter-naas/get-chagelog-diff@v1.0.0
- name: Slack notification
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: Naas # Optional. (defaults to webhook app)
SLACK_CHANNEL: naas-ci # Optional. (defaults to webhook)
SLACK_AVATAR: repository
SLACK_CUSTOM_PAYLOAD: '{"attachments":[{"color":"#47dd82","blocks":[{"type":"section","block_id":"section567","text":{"type":"mrkdwn","text":"<https://github.com/{{ GITHUB_REPOSITORY }}|{{ GITHUB_REPOSITORY }}>\nAvailable to pip and docker hub.\n*Version*\n${{ steps.get-latest-tag.outputs.tag }}\n ${{ steps.lastchanges.outputs.lastChanges }}"},"accessory":{"type":"image","image_url":"https://github.com/jupyter-naas/naas/raw/main/custom/naas-fav.png","alt_text":"Naas logo"}}]}]}'
uses: Ilshidur/action-slack@2.0.2