CQ image #26
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
# Find full documentation here https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions | |
name: CQ image | |
on: | |
pull_request: | |
paths: | |
- 'containers/cloudquery/**' | |
push: | |
branches: | |
- main | |
paths: | |
- 'containers/cloudquery/**' | |
# Manual invocation. | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }}/cloudquery | |
# Ensure we only ever have one build running at a time. | |
# If we push twice in quick succession, the first build will be stopped once the second starts. | |
# This avoids any race conditions. | |
concurrency: | |
group: ${{ github.ref }}/cloudquery | |
cancel-in-progress: true | |
jobs: | |
CQ_CLI: | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- name: Set CQ_CLI | |
run: | | |
source .env | |
echo $CQ_CLI | |
echo "CQ_CLI=${CQ_CLI}" >> "$GITHUB_ENV" | |
outputs: | |
CQ_CLI: ${{ env.CQ_CLI }} | |
build-and-push: | |
needs: CQ_CLI | |
uses: ./.github/workflows/release-image.yml | |
with: | |
IMAGE_NAME: cloudquery | |
BUILD_ARGS: CQ_CLI=${{ needs.CQ_CLI.outputs.CQ_CLI }} | |
permissions: | |
contents: read | |
packages: write |