fix: fix issue with env variable usage for version tag checks #5
Workflow file for this run
This file contains hidden or 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
| # SPDX-FileCopyrightText: 2014-2026 Institute for Automation of Complex Power Systems, RWTH Aachen University | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| name: Deploy | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| is_version_tag: | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| env: | ||
| REGISTRY: ghcr.io | ||
| DOCKER_IMAGE: ghcr.io/villasframework/villas/node | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| jobs: | ||
| deploy-docker: | ||
| name: deploy:docker | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: docker/setup-buildx-action@v3 | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Create and push multi-arch manifest | ||
| run: | | ||
| docker buildx imagetools create \ | ||
| -t "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" \ | ||
| "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ | ||
| "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" | ||
| deploy-docker-dev: | ||
| name: deploy:docker-dev | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: docker/setup-buildx-action@v3 | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Publish dev image for current ref | ||
| run: | | ||
| docker buildx imagetools create \ | ||
| -t "${{ env.DOCKER_IMAGE }}/dev:${{ github.ref_name }}" \ | ||
| "${{ env.DOCKER_IMAGE }}/dev-fedora:${{ github.ref_name }}" | ||
| deploy-docker-dev-vscode: | ||
| name: deploy:docker-dev-vscode | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: docker/setup-buildx-action@v3 | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Publish dev-vscode image for current ref | ||
| run: | | ||
| docker buildx imagetools create \ | ||
| -t "${{ env.DOCKER_IMAGE }}/dev-vscode:${{ github.ref_name }}" \ | ||
| "${{ env.DOCKER_IMAGE }}/dev-vscode:${{ github.ref_name }}" | ||
| latest-docker: | ||
| name: latest:docker | ||
| if: inputs.is_version_tag | ||
| needs: [deploy-docker] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Tag and push app image as latest | ||
| run: | | ||
| docker manifest rm "${{ env.DOCKER_IMAGE }}:latest" || true | ||
| docker manifest create "${{ env.DOCKER_IMAGE }}:latest" \ | ||
| "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ | ||
| "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" | ||
| docker manifest push "${{ env.DOCKER_IMAGE }}:latest" | ||
| latest-docker-dev: | ||
| name: latest:docker-dev | ||
| if: inputs.is_version_tag | ||
| needs: [deploy-docker-dev] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: docker/setup-buildx-action@v3 | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Tag and push dev image as latest | ||
| run: | | ||
| docker buildx imagetools create \ | ||
| -t "${{ env.DOCKER_IMAGE }}/dev:latest" \ | ||
| "${{ env.DOCKER_IMAGE }}/dev:${{ github.ref_name }}" | ||
| latest-docker-manual: | ||
| name: latest:docker (manual) | ||
| if: !inputs.is_version_tag | ||
| needs: [deploy-docker] | ||
| runs-on: ubuntu-latest | ||
| environment: latest-docker-manual | ||
| steps: | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Tag and push app image as latest (manual) | ||
| run: | | ||
| docker manifest rm "${{ env.DOCKER_IMAGE }}:latest" || true | ||
| docker manifest create "${{ env.DOCKER_IMAGE }}:latest" \ | ||
| "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ | ||
| "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" | ||
| docker manifest push "${{ env.DOCKER_IMAGE }}:latest" | ||
| latest-docker-dev-manual: | ||
| name: latest:docker-dev (manual) | ||
| if: !inputs.is_version_tag | ||
| needs: [deploy-docker-dev] | ||
| runs-on: ubuntu-latest | ||
| environment: latest-docker-dev-manual | ||
| steps: | ||
| - uses: docker/setup-buildx-action@v3 | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Tag and push dev image as latest (manual) | ||
| run: | | ||
| docker buildx imagetools create \ | ||
| -t "${{ env.DOCKER_IMAGE }}/dev:latest" \ | ||
| "${{ env.DOCKER_IMAGE }}/dev:${{ github.ref_name }}" | ||