-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (62 loc) · 2.06 KB
/
build.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
---
name: DAS CLI Build
on:
workflow_dispatch:
inputs:
version:
description: "Version"
required: true
jobs:
build-jupyter-notebook:
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Dockerfile
run: docker build -f .docker/Dockerfile.jupyter-notebook -t trueagi/das:latest-jupyter-notebook .
- name: Login to DockerHub
if: success()
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to DockerHub
run: docker push trueagi/das:latest-jupyter-notebook
build-and-run-tests:
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/run-tests.yml
tag:
needs: build-and-run-tests
if: github.ref == 'refs/heads/master'
uses: singnet/das/.github/workflows/run-semver.yml@master
with:
version: ${{ github.event.inputs.version }}
version-strategy: bump-version-from-variable-value
job-image-namespace: trueagi
job-image-version-semver: semantic-versioning
main-branch: master
version-tag-regex-pattern: /^\d+\.\d+\.\d+$/
version-require-confirmation: "true"
title: New version of das-cli
deliverable: Debian package named das-cli
secrets: inherit
deploy-das-cli:
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/master'
needs: build-and-run-tests
steps:
- name: Set up SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts
- name: Download das-cli artifact
uses: actions/download-artifact@v4
with:
name: das-cli
path: packages
- name: Copy files to server
run: |
scp -r packages/* ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}:${{ vars.SERVER_DEB_PACKAGES_PATH }}