-
-
Notifications
You must be signed in to change notification settings - Fork 38
71 lines (69 loc) · 2.44 KB
/
Copy pathrelease.yaml
File metadata and controls
71 lines (69 loc) · 2.44 KB
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
# On tag, create Draft Release and Publish docker images
name: Release on Tag
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*.*.*" # Push events to matching v*.*.*, i.e. v20.15.10
pull_request:
branches:
- master
jobs:
release:
# Draft Release with assets: k8s YAML
name: Draft Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Install kustomize
run: |
curl -L https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv3.5.4/kustomize_v3.5.4_linux_amd64.tar.gz | tar zxv
chmod u+x kustomize
sudo mv kustomize /usr/local/bin/
- name: Build kustomize
run: |
make build/kustomize
- name: Create Release
id: create_release
# Drafts your next Release notes as Pull Requests are merged into "master"
# uses: toolmantim/release-drafter@v5.2.0
uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
- name: Upload Release Assets
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/kubernetes.local.yaml
asset_name: kubernetes.local.yaml
asset_content_type: text/vnd.yaml
docker:
name: Build and Publish docker images
runs-on: ubuntu-latest
# needs: [release]
steps:
- name: Check out Code
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Build docker images
run: make docker DOCKER_REGISTRY=docker.pkg.github.com DOCKER_CONTEXT_PATH=$GITHUB_REPOSITORY
- name: Push docker images
if: github.ref == 'refs/heads/master'
run: |
# docker login docker.pkg.github.com --username $GITHUB_ACTOR --password ${{ secrets.GITHUB_DOCKER_PASSWORD }}
docker login docker.pkg.github.com --username $GITHUB_ACTOR --password ${{ secrets.GITHUB_TOKEN }}
make docker_push
echo "make docker_push done"
# TODO https://github.com/marketplace/actions/publish-docker