-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.28 KB
/
cq-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- 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