-
Notifications
You must be signed in to change notification settings - Fork 12
95 lines (89 loc) · 2.88 KB
/
cd.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
name: Continous Deployment
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
releaseer:
runs-on: ubuntu-latest
steps:
-
name: Create release
id: release-please
uses: google-github-actions/release-please-action@v3
with:
release-type: python
package-name: scicon
-
name: Print Release Info
if: ${{ steps.release-please.outputs.release_created }}
shell: bash
run: |
echo "Release Version: ${{ steps.release-please.outputs.tag_name }}"
outputs:
release_created: ${{ steps.release-please.outputs.releases_created }}
releases: ${{ steps.release-please.outputs.releases }}
tag_name: ${{ steps.release-please.outputs.tag_name }}
build:
runs-on: ubuntu-latest
needs: releaseer
if : ${{ needs.releaseer.outputs.release_created }}
strategy:
matrix:
python-version: [3.9]
steps:
-
name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 1
-
name: Fetch Release Tags
id: metadata
run: |
echo "Creating Release Metadata"
echo "Release Ver: ${{ needs.releaseer.outputs.releases }}"
echo "Release Tag: ${{ needs.releaseer.outputs.tag_name }}"
# REGISTRY="images.canfar.net/"
# echo REGISTRY=${REGISTRY} >> $GITHUB_OUTPUT
# IMAGE="canfar/base"
# echo IMAGE=${IMAGE} >> $GITHUB_OUTPUT
# TAG=${{ matrix.info.tag_name }}
# echo TAG=${TAG} >> $GITHUB_OUTPUT
# echo IMAGE_LATEST=${REGISTRY}${IMAGE}:latest >> $GITHUB_OUTPUT
# echo IMAGE_TAGGED=${REGISTRY}${IMAGE}:${TAG} >> $GITHUB_OUTPUT
# -
# name: Setup Docker Buildx Environment
# if: ${{ steps.release-please.outputs.release_created }}
# id: buildx
# uses: docker/setup-buildx-action@v1
# with:
# install: true
# -
# name: Perform CANFAR Harbor Login
# if: ${{ steps.release-please.outputs.release_created }}
# uses: docker/login-action@v1
# with:
# registry: images.canfar.net
# username: ${{ secrets.HARBOR_CANFAR_USERNAME }}
# password: ${{ secrets.HARBOR_CANFAR_PASSWORD }}
# -
# name: Build & Push Production Image
# if: ${{ steps.release-please.outputs.release_created }}
# uses: docker/build-push-action@v3
# id: build-push-production
# with:
# context: .
# file: scicon/images/base/Dockerfile
# platforms: linux/amd64
# build-args:
# PYTHON_VERSION=3.9
# tags: |
# ${{ steps.metadata.outputs.IMAGE_LATEST }}
# ${{ steps.metadata.outputs.IMAGE_TAGGED }}
# push: true
# cache-from: type=gha
# cache-to: type=gha,mode=max