Skip to content

Add pre packages

Add pre packages #26

name: Update Fix Inventory Infrastucture Apps Index
on:
push:
tags:
- "*.*.*"
branches:
- main
pull_request:
paths:
- './**'
- '.github/**'
workflow_dispatch:
jobs:
fixinventory-apps:
name: "fixinventory-apps"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
architecture: 'x64'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install python-dateutil
pip install --pre fixinventoryappbundler
- name: Build the index
run: |
fixinventoryappbundler --discover --path . > index.json
- name: Upload the index to the CDN
if: github.ref_type == 'tag' || github.event_name == 'workflow_dispatch'
run: |
sudo apt-get update
sudo apt-get install -y s3cmd
umask 0077
cat > ~/.s3cfg << EOL
[default]
access_key = ${{ secrets.SPACES_ACCESS_KEY_ID }}
secret_key = ${{ secrets.SPACES_SECRET_ACCESS_KEY }}
bucket_location = ${{ secrets.SPACES_REGION }}
host_base = ${{ secrets.SPACES_REGION }}.digitaloceanspaces.com
host_bucket = %(bucket)s.${{ secrets.SPACES_REGION }}.digitaloceanspaces.com
EOL
s3cmd put index.json s3://${{ secrets.SPACES_NAME }}/fixinventory/apps/ --acl-public
rm -f ~/.s3cfg
curl -X DELETE -H "Content-Type: application/json" -H "Authorization: Bearer ${{ secrets.API_TOKEN }}" -d '{"files": ["/fixinventory/apps/index.json"]}' "https://api.digitalocean.com/v2/cdn/endpoints/${{ secrets.CDN_ENDPOINT_ID }}/cache"