Build and release versioned container images #8
Workflow file for this run
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
--- | |
name: Build and release versioned container images | |
# yamllint disable-line rule:truthy | |
on: | |
create | |
jobs: | |
tag_image: | |
name: Build and release the bundle container-image | |
if: > | |
github.repository == 'ceph/ceph-cosi' | |
&& | |
github.ref_type == 'tag' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Setup Golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
- name: Generate the container image | |
run: make container | |
- name: Login to quay.io | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Set up QEMU for multi-arch builds | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: 'arm64' | |
- name: Build bundle container image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Dockerfile | |
push: true | |
tags: quay.io/ceph/cosi:${{ github.ref_name }} | |
platforms: linux/amd64,linux/arm64 | |
publish_release: | |
name: Publish a release based on the tag | |
if: > | |
github.repository == 'ceph/ceph-cosi' | |
&& | |
github.ref_type == 'tag' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Setup Golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
- name: Publish the release and attach YAML files | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ github.ref_name }} | |
artifacts: "examples/*.yaml" | |
generateReleaseNotes: true | |
token: ${{ secrets.GITHUB_TOKEN }} |