Skip to content

Deploy BlueOS Extension Image #229

Deploy BlueOS Extension Image

Deploy BlueOS Extension Image #229

Workflow file for this run

name: Deploy BlueOS Extension Image
on:
schedule:
# Run every day at 11:00 UTC
- cron: '0 11 * * *'
# The workflow can update the repo, so don't run on push, but do allow running manually
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
commit: ${{ steps.commit.outputs.updated }}
tag: ${{ steps.version.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Git submodule update
run: |
git submodule update --init --recursive --remote
- name: Commit update
id: commit
run: |
git config --global user.name 'Git bot'
git config --global user.email 'bot@noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -am "submodules: Updated references" && git push && echo "updated=true" >> "$GITHUB_OUTPUT" ||
echo "No changes to commit" && echo "updated=false" >> "$GITHUB_OUTPUT"
- name: Update version
id: version
if: ${{ steps.commit.outputs.updated == 'true' }}
run: |
./update_version.py >> "$GITHUB_OUTPUT"
- name: Commit version
if: steps.commit.outputs.updated == 'true'
run: |
git config --global user.name 'Git bot'
git config --global user.email 'bot@noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -am "Dockerfile: updated Extension version" && git push || echo "Daily version already released"
deploy-docker-image:
# only deploy an update if there are new changes, or the workflow is running manually
needs: sync
if: ${{ needs.sync.outputs.commit == 'true' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: |
wget -q -O - https://github.com/getzola/zola/releases/download/v0.19.2/zola-v0.19.2-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C /usr/local/bin
chmod +x /usr/local/bin/zola
- name: Populate docs
run: |
./populate_docs.py
- name: Deploy BlueOS Extension
uses: BlueOS-community/Deploy-BlueOS-Extension@v1
with:
docker-username: ${{ secrets.DOCKER_USERNAME }}
docker-password: ${{ secrets.DOCKER_PASSWORD }}
github-token: ${{ secrets.GITHUB_TOKEN }}
# image-name should not start with blueos- (see image-prefix)
image-name: 'docs'
image-tag: ${{ needs.sync.outputs.tag }}
skip-checkout: true