Skip to content

wip: Add deploy workflow #17

wip: Add deploy workflow

wip: Add deploy workflow #17

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
with:
workflow: build.yml
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"
url_part=$(echo "$CLOUD_URL" | cut -d'/' -f6)
base_dir="${{ steps.parse_directories.outputs.base_dir }}"
model="${{ steps.parse_directories.outputs.model }}"
release="${{ steps.parse_directories.outputs.release }}"
CURL_CMD="curl -u $url_part:$CLOUD_PASSWORD"
new_name=$(echo "${{ matrix.vendor }}-${{ matrix.model }}.rom" | sed 's/-/_/g; s/.*/\L&/')
# Create release directory if it doesn't exist
$CURL_CMD -X MKCOL "$BASE_URL/$base_dir/$model/$release"
$CURL_CMD -X PUT -T "artifacts/coreboot.rom" "$BASE_URL/$base_dir/$model/$release/$new_name"
deploy_novacustom:
runs-on: ubuntu-22.04
if: contains(github.ref, 'refs/tags/protectli')
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="novacustom"
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
with:
workflow: build.yml
name: ${{ steps.parse_directories.outputs.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"
url_part=$(echo "$CLOUD_URL" | cut -d'/' -f6)
base_dir="${{ steps.parse_directories.outputs.base_dir }}"
model="${{ steps.parse_directories.outputs.model }}"
release="${{ steps.parse_directories.outputs.release }}"
CURL_CMD="curl -u $url_part:$CLOUD_PASSWORD"
new_name=$(echo "${model}.rom" | sed 's/-/_/g; s/.*/\L&/')
# Create release directory if it doesn't exist
$CURL_CMD -X MKCOL "$BASE_URL/$base_dir/$model/$release"
$CURL_CMD -X PUT -T "artifacts/coreboot.rom" "$BASE_URL/$base_dir/$model/$release/$new_name"