diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 172d21b..85abd1c 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -8,23 +8,7 @@ concurrency: cancel-in-progress: true jobs: - # QuickStart apps build from the same dirs as their Dockerfiles - build: - permissions: - packages: write - name: Build - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: ./ - with: - package: backend - keep_versions: 10 - repository: bcgov/quickstart-openshift - tag: ${{ github.event.number }} - - # Anything can be retagged if a fallback image exists (e.g. test) - retag: + test: needs: [build] permissions: packages: write @@ -32,29 +16,8 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - - uses: ./ - with: - package: backend - keep_versions: 10 - repository: bcgov/quickstart-openshift - tag: ${{ github.event.number }}-retag - tag_fallback: test - triggers: ('backend/') - - - # FOM apps build from repo root, above their Dockerfiles (extra params) - advanced: - permissions: - packages: write - name: Advanced - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: ./ - with: - package: api - build_context: . - build_file: api/Dockerfile - keep_versions: 10 - repository: bcgov/nr-fom - tag: ${{ github.event.number }} + - id: vars + uses: ./ + + - name: Echo PR number + run: echo "PR: ${{ steps.vars.outputs.pr }}" diff --git a/action.yml b/action.yml index 9f48824..caed3a5 100644 --- a/action.yml +++ b/action.yml @@ -6,56 +6,26 @@ branding: inputs: ### Required - package: - description: Package name; e.g. backend, frontend - required: true - tag: - description: Default tag; e.g. pr#, test, prod - required: true + # Nothing! ### Typical / recommended - tag_fallback: - description: Where to pull default images from; e.g. prod, test - triggers: - description: Paths used to trigger a build; e.g. ('./backend/' './frontend/) - build_context: - description: Build context, not required for self-contained package/default directory - build_file: - description: Dockerfile with path, not required for self-contained package/default directory - keep_versions: - description: Number of versions to keep; omit to skip + # Nothing! ### Usually a bad idea / not recommended - build_args: - description: A list of build-time variables, generally not adviseable - value: "BUILDKIT_INLINE_CACHE=1" - diff_branch: - description: Branch to diff against - default: ${{ github.event.repository.default_branch }} - keep_regex: - description: Regex for tags to skip when keep_versions is provided; defaults to test and prod - default: "^(prod|test|latest)$" - repository: - description: Non-default repo to clone - default: ${{ github.repository }} token: description: Specify token (GH or PAT), instead of inheriting one from the calling workflow default: ${{ github.token }} outputs: - digest: - description: 'Digest of the built image. for ex: sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' - value: ${{ steps.get_digest.outputs.digest }} + pr: + description: 'Associated pull request number' + value: ${{ steps.vars.outputs.pr }} runs: using: composite steps: - - uses: actions/checkout@v4 - with: - # Check out build repo - repository: ${{ inputs.repository }} - # Process variables and inputs + - uses: actions/checkout@v4 - id: vars shell: bash run: |