-
Notifications
You must be signed in to change notification settings - Fork 18
74 lines (63 loc) · 1.99 KB
/
openstack.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
name: Upload Image to OpenStack
on:
workflow_dispatch:
inputs:
image_name:
description: 'Image name'
type: string
required: true
input_image_name:
description: 'Input Image Name in GCS'
type: string
required: true
env:
OS_AUTH_URL: https://ci.quansight.dev/in-api/identity
OS_IDENTITY_API_VERSION: 3
OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
OS_PROJECT_DOMAIN_NAME: Default
OS_PROJECT_NAME: ${{ secrets.OS_USERNAME }}
OS_REGION_NAME: RegionOne
OS_TENANT_NAME: ${{ secrets.OS_USERNAME }}
OS_USERNAME: ${{ secrets.OS_USERNAME }}
OS_USER_DOMAIN_NAME: Default
INPUT_IMAGE: /tmp/input-image
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v3
- name: Setup Miniconda
uses: conda-incubator/[email protected]
with:
python-version: "3.10"
miniconda-version: "latest"
- name: Install openstack client
run: |
pip install python-openstackclient==6.0.0
- name: Check Openstack client
run: |
openstack help
- name: Save GCP Creds
run: |
echo '${{ secrets.GOOGLE_CREDENTIALS }}' > /tmp/gcp.json
- uses: actions/checkout@v3
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v0'
with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
- name: Download image from GCS
run: |
gcloud auth activate-service-account --key-file /tmp/gcp.json --project aktech-labs
mkdir $INPUT_IMAGE
gsutil cp gs://cirun/images/${{ inputs.input_image_name }} $INPUT_IMAGE/
ls $INPUT_IMAGE
- name: Upload image
run: |
openstack image create ${{ inputs.image_name }} \
--public --disk-format qcow2 \
--container-format bare \
--file $INPUT_IMAGE/${{ inputs.input_image_name }}