From 443b665f457a237b19205c04b3cfbcd211821119 Mon Sep 17 00:00:00 2001 From: haitomatic Date: Tue, 6 Feb 2024 12:02:19 +0000 Subject: [PATCH] workflow: add px4 sitl gzsim docker image build and push --- .github/workflows/tiiuae-sitl-gzsim.yaml | 68 ++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/tiiuae-sitl-gzsim.yaml diff --git a/.github/workflows/tiiuae-sitl-gzsim.yaml b/.github/workflows/tiiuae-sitl-gzsim.yaml new file mode 100644 index 000000000000..3d66914d6e77 --- /dev/null +++ b/.github/workflows/tiiuae-sitl-gzsim.yaml @@ -0,0 +1,68 @@ +name: tii-px4-sitl-gzsim + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +permissions: + contents: read + packages: write + +jobs: + tii-px4-sitl-gzsim: + runs-on: ubuntu-latest + services: + registry: + image: registry:2 + ports: + - 5000:5000 + steps: + + - name: Checkout px4-firmware + uses: actions/checkout@v4 + with: + path: px4-firmware + + - uses: docker/setup-buildx-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver-opts: network=host + + - name: Prepare px4-firmware + run: | + set -eux + cd px4-firmware + ./clone_public.sh + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/tiiuae/tii-px4-sitl-gzsim + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=sha + type=raw,value=latest + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build tii-px4-sitl-gzsim image and push + uses: docker/build-push-action@v5 + with: + context: ./px4-firmware/packaging + file: ./px4-firmware/packaging/Dockerfile.sitl_gzsim + pull: true + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}