Skip to content

wip: Add deploy workflow #5

wip: Add deploy workflow

wip: Add deploy workflow #5

Workflow file for this run

name: Deploy
on:
push:
tags:
- '*'
jobs:
deploy_protectli:
runs-on: ubuntu-22.04
if: contains(github.ref, 'refs/tags/protectli')
strategy:
matrix:
vendor: [ protectli ]
model: [ vp66xx, vp46xx, vp2420, vp2410, V1210, V1211, V1410, V1610 ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout all submodules
run: git submodule update --init --recursive --checkout
- name: Set up tag name
id: tag_name
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
- name: Parse directories from tag
id: parse_directories
run: |
tag=${{ steps.tag_name.outputs.tag }}
base_dir="protectli"
model=$(echo "$tag" | cut -d'_' -f1-3)
release=$(echo "$tag" | cut -d'_' -f4)
echo "::set-output name=base_dir::$base_dir"
echo "::set-output name=model::$model"
echo "::set-output name=release::$release"
# Allows downloading artifacts from a different workflow
- name: Download workflow artifact
uses: dawidd6/action-download-artifact@v6
workflow: build.yml

Check failure on line 40 in .github/workflows/deploy.yml

View workflow run for this annotation

GitHub Actions / Deploy

Invalid workflow file

The workflow is not valid. .github/workflows/deploy.yml (Line: 40, Col: 9): Unexpected value 'workflow' .github/workflows/deploy.yml (Line: 41, Col: 9): 'name' is already defined
name: "dasharo-${{ matrix.vendor }}-${{ matrix.model }}"
path: "./artifacts"
- name: Upload to Nextcloud
env:
CLOUD_URL: ${{ secrets.CLOUD_URL }}
CLOUD_PASSWORD: ${{ secrets.CLOUD_PASSWORD }}
run: |
BASE_URL="https://cloud.3mdeb.com/public.php/webdav"
HEADER="X-Requested-With: XMLHttpRequest"
CURL_CMD="curl -u $url_part:$CLOUD_PASSWORD -H $HEADER"
base_dir="${{ steps.parse_directories.outputs.base_dir }}"
model="${{ steps.parse_directories.outputs.model }}"
release="${{ steps.parse_directories.outputs.release }}"
url_part=$(echo "$CLOUD_URL" | cut -d'/' -f6)
# Create release directory if it doesn't exist
$CURL_CMD -X MKCOL "$BASE_URL/$base_dir/$model/$release"
$CURL_CMD -X PUT -T "dasharo-${{ matrix.vendor }}-${{ matrix.model }}" "$CLOUD_URL/$base_dir/$model/$release/"