Skip to content

Commit

Permalink
Update build_containers.yml
Browse files Browse the repository at this point in the history
Extend the usage of the docker actions to support tagging using the version tagging on the repo
  • Loading branch information
alexlovelltroy authored Apr 17, 2024
1 parent 12b5d5a commit c0e6e23
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions .github/workflows/build_containers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: build and publish containers
on: workflow_dispatch
on:
push:
tags:
- v*
permissions:
packages: write
contents: read
Expand All @@ -9,6 +12,23 @@ jobs:
steps:
- name: check out the repo
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
openchami/local-ca
ghcr.io/openchami/local-ca
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to github container repo
Expand All @@ -17,9 +37,10 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build+push
- name: Build and push
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:local-ca"
push: true
tags: ghcr.io/openchami/local-ca:acme
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit c0e6e23

Please sign in to comment.