Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 1 | # 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 | |
| 15 | name: manila |
| 16 | |
| 17 | on: |
| 18 | pull_request: |
| 19 | paths: |
| 20 | - .github/workflows/manila.yml |
| 21 | push: |
| 22 | branches: |
| 23 | - main |
| 24 | paths: |
| 25 | - .github/workflows/manila.yml |
Mohammed Naser | 0195426 | 2025-02-16 22:55:55 -0500 | [diff] [blame] | 26 | tags: |
| 27 | - v* |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 28 | workflow_dispatch: |
| 29 | |
| 30 | jobs: |
| 31 | build-image: |
| 32 | runs-on: ubuntu-latest |
| 33 | steps: |
| 34 | - name: Checkout project |
Mohammed Naser | e988c4b | 2025-03-04 10:19:45 -0500 | [diff] [blame] | 35 | uses: actions/checkout@v4 |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 36 | with: |
| 37 | fetch-depth: 0 |
| 38 | |
| 39 | - name: Install dependencies |
| 40 | run: | |
ricolin | a586ec5 | 2023-06-02 00:14:44 +0800 | [diff] [blame] | 41 | sudo apt-get update |
Mohammed Naser | 6080c9b | 2024-07-18 10:43:09 -0400 | [diff] [blame] | 42 | sudo apt-get install -y debootstrap tox qemu-utils |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 43 | pipx install python-swiftclient |
Mohammed Naser | 2607b55 | 2023-03-27 23:39:42 +0000 | [diff] [blame] | 44 | pipx inject python-swiftclient python-keystoneclient |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 45 | |
| 46 | - name: Cache DIB_IMAGE_CACHE |
Mohammed Naser | e988c4b | 2025-03-04 10:19:45 -0500 | [diff] [blame] | 47 | id: cache-dib-image-cache |
| 48 | uses: actions/cache/restore@v4 |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 49 | with: |
| 50 | path: ~/.cache/image-create |
| 51 | key: dib-image-cache |
| 52 | |
| 53 | - name: Build image |
Mohammed Naser | 6080c9b | 2024-07-18 10:43:09 -0400 | [diff] [blame] | 54 | run: tox -ebuild-manila-image |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 55 | |
Mohammed Naser | e988c4b | 2025-03-04 10:19:45 -0500 | [diff] [blame] | 56 | - name: Save DIB_IMAGE_CACHE |
| 57 | id: dib-image-cache-save |
| 58 | uses: actions/cache/save@v4 |
| 59 | with: |
| 60 | path: ~/.cache/image-create |
| 61 | key: ${{ steps.cache-dib-image-cache.outputs.cache-primary-key }} |
| 62 | |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 63 | - name: Publish image |
Mohammed Naser | 1ec06f7 | 2023-03-28 02:56:40 +0000 | [diff] [blame] | 64 | if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'release' |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 65 | run: | |
| 66 | swift post -r '.r:*,.rlistings' atmosphere-images |
Mohammed Naser | 6080c9b | 2024-07-18 10:43:09 -0400 | [diff] [blame] | 67 | swift upload atmosphere-images manila-*.qcow2 |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 68 | env: |
| 69 | OS_AUTH_URL: https://auth.vexxhost.net/v3 |
| 70 | OS_REGION_NAME: ca-ymq-1 |
| 71 | OS_USER_DOMAIN_NAME: Default |
| 72 | OS_USERNAME: ${{ secrets.OS_USERNAME }} |
| 73 | OS_PASSWORD: ${{ secrets.OS_PASSWORD }} |
| 74 | OS_PROJECT_DOMAIN_NAME: Default |
| 75 | OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }} |