forked from oracle-samples/oci-data-science-ai-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 2.08 KB
/
stack.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
# Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
# Creates and Publishes the Oracle Resource Manager stack - v0.0.5
name: Generate stacks and publish release
on:
push:
branches: [ main ]
paths: ['VERSION']
jobs:
publish_stack:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create stacks
id: create_stacks
run: |
STACKNAME=oci-ods-aqua
STACK_FILES="ai-quick-actions/policies/terraform/*"
RELEASE=$(cat VERSION)
ASSETS+="${STACKNAME}.zip"
echo "::group::Processing $STACKNAME"
zip -r ${STACKNAME}-stack.zip $STACK_FILES || { printf '\n⛔ Unable to create %s stack.\n'; exit 1; }
cp ${STACKNAME}-stack.zip ${STACKNAME}.zip || { printf '\n⛔ Unable to create %s stack.\n'; exit 1; }
echo "::endgroup::"
echo "::set-output name=assets::$ASSETS"
echo "::set-output name=release::$RELEASE"
echo "::set-output name=prefix::$STACKNAME"
- name: Prepare Release Notes
run: |
#
printf '%s\n' '${{ steps.create_stacks.outputs.prefix }} Stack - v${{ steps.create_stacks.outputs.release }}' >release.md
printf '%s\n' '' '## [![Deploy to Oracle Cloud][magic_button]][magic_stack]' >>release.md
printf '%s\n' '' '' >>release.md
printf '%s\n' '' '[magic_button]: https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg' >>release.md
printf '%s\n' '' '[magic_stack]: https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/${{ github.repository }}/releases/download/${{ steps.create_stacks.outputs.release }}/${{ steps.create_stacks.outputs.prefix }}.zip' >>release.md
- name: Create Release
run: gh release create ${{ steps.create_stacks.outputs.release }} --generate-notes -F release.md ${{ steps.create_stacks.outputs.assets }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}