github action #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy new version | |
# Only deploy when a new tag is pushed | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
# Must match the project() name in CMakeLists.txt | |
env: | |
APP_NAME: pico_trigger_uart | |
# Allow this workflow to write back to the repository | |
permissions: | |
contents: write | |
# Build binary and send to releases | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
name: Build and deploy | |
steps: | |
- name: Check out this repository | |
uses: actions/checkout@v3 | |
- name: Build Docker image | |
run: docker build -t pico-builder-image . | |
- name: Create Docker container | |
run: docker create --name pico-builder-container pico-builder-image | |
- name: Copy out .uf2 file | |
run: docker cp pico-builder-container:/project/src/build/${APP_NAME}.uf2 ./${APP_NAME}.uf2 | |
- name: Put environment variable into the env context | |
run: echo "app_name=$APP_NAME" >> $GITHUB_ENV | |
- name: Push to release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ${{ env.app_name }}.uf2 | |
body_path: CHANGELOG.md |