Skip to content

Commit

Permalink
[#211] Updated tags to match workflow triggers. (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
GROwen authored Oct 24, 2023
1 parent 6cae0a0 commit 6ef4fb5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: build-deploy-bay-images
run-name: Build and deploy Bay images
on:
schedule:
- cron: '23 20 * * 0'
workflow_dispatch:
pull_request:
branches:
- '5.x'
pull_request_target:
types:
- closed
- opened
- synchronize
schedule:
- cron: '23 20 * * 0'
workflow_dispatch:

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -43,14 +42,14 @@ jobs:
images: |
${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.images }}
tags: |
type=ref,event=pr
type=ref,event=branch
type=raw,value={{github.event.pull_request.head.ref}},enable=${{ github.event.pull_request.merged == true }}
type=ref,event=pr,enable=${{ github.event.pull_request.merged == false }}
type=raw,value=${{ github.event.pull_request.base.ref }},enable=${{ github.event.pull_request.merged == true }}
type=ref,event=branch,enable=${{ contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) }}
labels: |
maintainer=Digital Victoria
repository=${{ github.repositoryUrl }}
org.opencontainers.image.authors=Digital Victoria
org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}/images/${{ matrix.images }}/Dockerfile
org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/${{ (contains(fromJson('["opened","synchronize"]'), github.event.action)) && github.head_ref || github.event.action == 'closed' && github.base_ref || github.ref_name }}/images/${{ matrix.images }}/Dockerfile
org.opencontainers.image.title=${{ matrix.images }}
org.opencontainers.image.description=${{ matrix.images }} image for Bay container platform
Expand All @@ -62,5 +61,4 @@ jobs:
./gh-actions-bake.hcl
${{ steps.meta.outputs.bake-file }}
# Target the default group - probably unnecessary.
# Target the default group - branchobably unnecessary.
targets: ${{ matrix.images }}
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,8 @@ Published images are scanned using Trivy and any CVEs identified are reported in
## Contribute
[Open an issue](https://github.com/dpc-sdp/bay) on GitHub or submit a pull request with suggested changes.

### Development Builds
GitHub Actions is configured to automatically build images for pull requests that use the branch naming convention `build/<docker_image_tag>`. This will generate the tag `build-<docker_image_tag>`.

For example

`build/2.x-updated-cli` will generate the tag `build-2-x-updated-cli` and would be referenced as `ghcr.io/dpc-sdp/bay/<bay-image>:build-2-x-updated-cli`.
### Development builds
GitHub Actions is configured via the [build-deploy workflow](.github/workflows/build-deploy.yml) to build images for pull requests when they are opened and receive updates. These images are tagged with the PR number i.e. pr-86.

## Support
[Digital Engagement, Department of Premier and Cabinet, Victoria, Australia](https://github.com/dpc-sdp)
Expand Down

0 comments on commit 6ef4fb5

Please sign in to comment.