fix missing slash #26
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: Images | |
on: | |
pull_request: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 5 * * 1,4' | |
defaults: | |
run: | |
shell: "bash -Eeuo pipefail -x {0}" | |
jobs: | |
init: | |
name: Generate Matrix | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.generate-matrix.outputs.matrix }} | |
version: ${{ steps.generate-matrix.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Generate job matrix from upstream versions.json | |
run: | | |
version=$(curl https://api.github.com/repos/nextcloud/docker/releases/latest | jq -r '.tag_name') | |
echo "version=$version" >> "$GITHUB_OUTPUT" | |
wget https://raw.githubusercontent.com/nextcloud/docker/$version/versions.json | |
echo "matrix=$(jq '{"base": (.[].variants | keys_unsorted | unique), "version": (map(.version) | unique | sort)}' versions.json | jq -cs '.[0]')" >> "$GITHUB_OUTPUT" | |
id: generate-matrix | |
build: | |
needs: init | |
strategy: | |
matrix: ${{ fromJson(needs.init.outputs.matrix) }} | |
name: "${{ matrix.base }}-${{ matrix.version }}" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to quay.io | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_TOKEN}} | |
- name: Generate docker tags | |
id: tags | |
uses: docker/metadata-action@v5 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
images: | | |
ghcr.io/${{ github.repository }} | |
quay.io/${{ github.repository }} | |
tags: | | |
type=semver,pattern={{version}},value=${{ matrix.version }},enable=${{ matrix.base == 'apache' }} | |
type=semver,pattern={{major}}.{{minor}},value=${{ matrix.version }},enable=${{ matrix.base == 'apache' }} | |
type=semver,pattern={{major}},value=${{ matrix.version }},enable=${{ matrix.base == 'apache' }} | |
type=semver,pattern={{version}}-${{ matrix.base }},value=${{ matrix.version }} | |
type=semver,pattern={{major}}.{{minor}}-${{ matrix.base }},value=${{ matrix.version }} | |
type=semver,pattern={{major}}-${{ matrix.base }},value=${{ matrix.version }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ steps.tags.outputs.tags }} | |
push: true | |
file: Dockerfile.${{ matrix.base }} | |
build-args: | | |
VERSION=${{ matrix.version }} |