blob: f43339dbdfd5075742f119ae31461d6d3a6fa880 [file] [log] [blame]
Mohammed Naser19871ba2023-03-27 22:38:39 +00001# Copyright (c) 2023 VEXXHOST, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15name: manila
16
17on:
18 pull_request:
19 paths:
20 - .github/workflows/manila.yml
21 push:
22 branches:
23 - main
24 paths:
25 - .github/workflows/manila.yml
Mohammed Naser88b17c62025-02-16 22:55:55 -050026 tags:
27 - v*
Mohammed Naser19871ba2023-03-27 22:38:39 +000028 workflow_dispatch:
29
30jobs:
31 build-image:
32 runs-on: ubuntu-latest
33 steps:
34 - name: Checkout project
Mohammed Naserf3152222024-07-19 00:40:24 -040035 uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
Mohammed Naser19871ba2023-03-27 22:38:39 +000036 with:
37 fetch-depth: 0
38
39 - name: Install dependencies
40 run: |
ricolina586ec52023-06-02 00:14:44 +080041 sudo apt-get update
Mohammed Naserf3152222024-07-19 00:40:24 -040042 sudo apt-get install -y debootstrap tox qemu-utils
Mohammed Naser19871ba2023-03-27 22:38:39 +000043 pipx install python-swiftclient
Mohammed Naser2607b552023-03-27 23:39:42 +000044 pipx inject python-swiftclient python-keystoneclient
Mohammed Naser19871ba2023-03-27 22:38:39 +000045
46 - name: Cache DIB_IMAGE_CACHE
renovate[bot]d7d88c02024-04-03 11:31:34 -040047 uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
Mohammed Naser19871ba2023-03-27 22:38:39 +000048 with:
49 path: ~/.cache/image-create
50 key: dib-image-cache
51
52 - name: Build image
Mohammed Naserf3152222024-07-19 00:40:24 -040053 run: tox -ebuild-manila-image
Mohammed Naser19871ba2023-03-27 22:38:39 +000054
55 - name: Publish image
Mohammed Naser1ec06f72023-03-28 02:56:40 +000056 if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'release'
Mohammed Naser19871ba2023-03-27 22:38:39 +000057 run: |
58 swift post -r '.r:*,.rlistings' atmosphere-images
Mohammed Naserf3152222024-07-19 00:40:24 -040059 swift upload atmosphere-images manila-*.qcow2
Mohammed Naser19871ba2023-03-27 22:38:39 +000060 env:
61 OS_AUTH_URL: https://auth.vexxhost.net/v3
62 OS_REGION_NAME: ca-ymq-1
63 OS_USER_DOMAIN_NAME: Default
64 OS_USERNAME: ${{ secrets.OS_USERNAME }}
65 OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
66 OS_PROJECT_DOMAIN_NAME: Default
67 OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}