Skip to content

ci: publish container and artifacts on merge to main #105

ci: publish container and artifacts on merge to main

ci: publish container and artifacts on merge to main #105

Workflow file for this run

name: CI/CD
on:
workflow_call:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
CI_IS_DEFAULT_BRANCH: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
CI_IS_TAG: ${{ startsWith(github.ref, 'refs/tags/') }}
# https://stackoverflow.com/a/72408109
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-inputs:
runs-on: ubuntu-24.04
outputs:
CI_CARGO_PROFILE: ${{ steps.set-profile.outputs.CI_CARGO_PROFILE }}
steps:
- name: Set CI_CARGO_PROFILE
id: set-profile
run: |
if [[ ${CI_IS_DEFAULT_BRANCH} == 'true' ]]; then
CI_CARGO_PROFILE="artifact" >> $GITHUB_OUTPUT
else
CI_CARGO_PROFILE="artifact-dev" >> $GITHUB_OUTPUT
fi
echo "CI_CARGO_PROFILE=${CI_CARGO_PROFILE}" >> $GITHUB_OUTPUT
echo "CI_CARGO_PROFILE=${CI_CARGO_PROFILE}"
rust:
needs: check-inputs
uses: ./.github/workflows/rust.yaml
with:
cargo-profile: ${{ needs.check-inputs.outputs.CI_CARGO_PROFILE }}
container:
needs: rust
uses: ./.github/workflows/container.yaml
with:
push: ${{ env.CI_IS_DEFAULT_BRANCH || env.CI_IS_TAG }}

Check failure on line 47 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / CI/CD

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yaml (Line: 47, Col: 13): Unrecognized named-value: 'env'. Located at position 1 within expression: env.CI_IS_DEFAULT_BRANCH || env.CI_IS_TAG .github/workflows/ci.yaml (Line: 48, Col: 24): Unrecognized named-value: 'env'. Located at position 3 within expression: ( env.CI_IS_DEFAULT_BRANCH && 'latest' ) || ''
additional-tags: ${{ ( env.CI_IS_DEFAULT_BRANCH && 'latest' ) || '' }}