chore(main): [bot] release ckan:1.0.0 (#4) #2
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: Release Image | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- main | |
paths: | |
- .github/release-please/manifest.json | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
release_please: | |
runs-on: ubuntu-latest | |
outputs: | |
releases_created: ${{ steps.release.outputs.releases_created }} | |
paths_released: ${{ steps.release.outputs.paths_released }} | |
steps: | |
- uses: googleapis/release-please-action@f3969c04a4ec81d7a9aa4010d84ae6a7602f86a7 # v4 | |
id: release | |
with: | |
skip-github-pull-request: true | |
token: ${{ secrets.ACTIONS_BOT_TOKEN }} | |
config-file: .github/release-please/config.json | |
manifest-file: .github/release-please/manifest.json | |
release_image: | |
runs-on: ubuntu-latest | |
needs: release_please | |
if: ${{ needs.release_please.outputs.releases_created }} | |
strategy: | |
matrix: | |
platform: | |
- linux/amd64 | |
- linux/arm64 | |
image: ${{ fromJson(needs.release_please.outputs.paths_released) }} | |
exclude: | |
- image: images/ckan | |
platform: linux/arm64 | |
- image: images/ckan-dcatapde | |
platform: linux/arm64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- name: Detect changes | |
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
id: filter | |
with: | |
filters: | | |
build: | |
- ${{ matrix.image }}/!(**.md) | |
- name: Get image name | |
env: | |
IMAGE: ${{ matrix.image }} | |
id: get-image-name | |
run: echo "fragment=${IMAGE##*/}" >> "$GITHUB_OUTPUT" | |
- name: Get image version | |
id: get-image-version | |
run: echo "version=$(jq -r '."${{ matrix.image }}"' < .github/release-please/manifest.json)" >> "$GITHUB_OUTPUT" | |
- name: Docker Metadata | |
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 | |
id: meta | |
with: | |
images: ${{ format('{0}/{1}/{2}', env.REGISTRY ,'teutonet/oci-images', steps.get-image-name.outputs.fragment ) }} | |
flavor: | | |
latest=false | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}},value=${{ steps.get-image-version.outputs.version }} | |
type=sha,prefix= | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 | |
- name: Set up Docker BuildX | |
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
id: push | |
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0 | |
with: | |
context: ${{ matrix.image }} | |
platforms: ${{ matrix.platform }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
push: ${{ github.event_name != 'pull_request' }} | |
abort: | |
runs-on: ubuntu-latest | |
needs: release_please | |
if: ${{ !needs.release_please.outputs.releases_created }} | |
steps: | |
- name: abort if no release was made | |
run: | | |
gh run cancel ${{ github.run_id }} | |
gh run watch ${{ github.run_id }} |