Reformat GitHub YAML files

This commit is contained in:
Héctor Molinero Fernández
2024-07-20 12:02:09 +02:00
parent 573d30cc72
commit 3414b17506
3 changed files with 64 additions and 64 deletions

View File

@@ -1,8 +1,8 @@
# yaml-language-server: $schema=https://json.schemastore.org/dependabot-2.0.json
version: 2 version: 2
updates: updates:
- package-ecosystem: "github-actions"
- package-ecosystem: 'github-actions' directory: "/"
directory: '/'
schedule: schedule:
interval: 'weekly' interval: "weekly"

View File

@@ -1,102 +1,102 @@
name: 'Main' # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Main"
on: on:
push: push:
tags: ['*'] tags: ["*"]
branches: ['*'] branches: ["*"]
pull_request: pull_request:
branches: ['*'] branches: ["*"]
workflow_dispatch: workflow_dispatch:
permissions: {} permissions: {}
jobs: jobs:
build: build:
name: 'Build ${{ matrix.arch }} image' name: "Build ${{ matrix.arch }} image"
runs-on: 'ubuntu-latest' runs-on: "ubuntu-latest"
permissions: permissions:
contents: 'read' contents: "read"
strategy: strategy:
matrix: matrix:
arch: ['native', 'amd64', 'arm64v8'] arch: ["native", "amd64", "arm64v8"]
steps: steps:
- name: 'Checkout project' - name: "Checkout project"
uses: 'actions/checkout@v4' uses: "actions/checkout@v4"
- name: 'Register binfmt entries' - name: "Register binfmt entries"
if: "matrix.arch != 'native'" if: "matrix.arch != 'native'"
run: | run: |
make binfmt-register make binfmt-register
- name: 'Build and save image' - name: "Build and save image"
run: | run: |
make IMAGE_BUILD_OPTS="--pull" "build-${{ matrix.arch }}-image" "save-${{ matrix.arch }}-image" make IMAGE_BUILD_OPTS="--pull" "build-${{ matrix.arch }}-image" "save-${{ matrix.arch }}-image"
- name: 'Upload artifacts' - name: "Upload artifacts"
if: "startsWith(github.ref, 'refs/tags/v') && matrix.arch != 'native'" if: "startsWith(github.ref, 'refs/tags/v') && matrix.arch != 'native'"
uses: 'actions/upload-artifact@v4' uses: "actions/upload-artifact@v4"
with: with:
name: 'dist-${{ matrix.arch }}' name: "dist-${{ matrix.arch }}"
path: './dist/' path: "./dist/"
retention-days: 1 retention-days: 1
push: push:
name: 'Push ${{ matrix.arch }} image' name: "Push ${{ matrix.arch }} image"
if: "startsWith(github.ref, 'refs/tags/v')" if: "startsWith(github.ref, 'refs/tags/v')"
needs: ['build'] needs: ["build"]
runs-on: 'ubuntu-latest' runs-on: "ubuntu-latest"
permissions: permissions:
contents: 'read' contents: "read"
strategy: strategy:
matrix: matrix:
arch: ['amd64', 'arm64v8'] arch: ["amd64", "arm64v8"]
steps: steps:
- name: 'Checkout project' - name: "Checkout project"
uses: 'actions/checkout@v4' uses: "actions/checkout@v4"
- name: 'Download artifacts' - name: "Download artifacts"
uses: 'actions/download-artifact@v4' uses: "actions/download-artifact@v4"
with: with:
name: 'dist-${{ matrix.arch }}' name: "dist-${{ matrix.arch }}"
path: './dist/' path: "./dist/"
- name: 'Login to Docker Hub' - name: "Login to Docker Hub"
uses: 'docker/login-action@v3' uses: "docker/login-action@v3"
with: with:
registry: 'docker.io' registry: "docker.io"
username: '${{ secrets.DOCKERHUB_USERNAME }}' username: "${{ secrets.DOCKERHUB_USERNAME }}"
password: '${{ secrets.DOCKERHUB_TOKEN }}' password: "${{ secrets.DOCKERHUB_TOKEN }}"
- name: 'Load and push image' - name: "Load and push image"
run: | run: |
make "load-${{ matrix.arch }}-image" "push-${{ matrix.arch }}-image" make "load-${{ matrix.arch }}-image" "push-${{ matrix.arch }}-image"
push-manifest: push-manifest:
name: 'Push manifest' name: "Push manifest"
if: "startsWith(github.ref, 'refs/tags/v')" if: "startsWith(github.ref, 'refs/tags/v')"
needs: ['push'] needs: ["push"]
runs-on: 'ubuntu-latest' runs-on: "ubuntu-latest"
permissions: permissions:
contents: 'read' contents: "read"
steps: steps:
- name: 'Checkout project' - name: "Checkout project"
uses: 'actions/checkout@v4' uses: "actions/checkout@v4"
- name: 'Login to Docker Hub' - name: "Login to Docker Hub"
uses: 'docker/login-action@v3' uses: "docker/login-action@v3"
with: with:
registry: 'docker.io' registry: "docker.io"
username: '${{ secrets.DOCKERHUB_USERNAME }}' username: "${{ secrets.DOCKERHUB_USERNAME }}"
password: '${{ secrets.DOCKERHUB_TOKEN }}' password: "${{ secrets.DOCKERHUB_TOKEN }}"
- name: 'Push manifest' - name: "Push manifest"
run: | run: |
make push-cross-manifest make push-cross-manifest
release-github: release-github:
name: 'Create GitHub release' name: "Create GitHub release"
if: "startsWith(github.ref, 'refs/tags/v')" if: "startsWith(github.ref, 'refs/tags/v')"
needs: ['push-manifest'] needs: ["push-manifest"]
runs-on: 'ubuntu-latest' runs-on: "ubuntu-latest"
permissions: permissions:
contents: 'write' contents: "write"
steps: steps:
- name: 'Create release' - name: "Create release"
env: env:
GITHUB_PAT: '${{ secrets.GITHUB_TOKEN }}' GITHUB_PAT: "${{ secrets.GITHUB_TOKEN }}"
run: | run: |
RELEASE_STATUS="$(curl -fs --proto '=https' --tlsv1.3 --globoff \ RELEASE_STATUS="$(curl -fs --proto '=https' --tlsv1.3 --globoff \
--url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/releases/tags/${GITHUB_REF_NAME:?}" \ --url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/releases/tags/${GITHUB_REF_NAME:?}" \

View File

@@ -1,23 +1,23 @@
name: 'Rebuild latest release' # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Rebuild latest release"
on: on:
schedule: schedule:
- cron: '20 04 * * 1' - cron: "20 04 * * 1"
workflow_dispatch: workflow_dispatch:
permissions: {} permissions: {}
jobs: jobs:
trigger-rebuild: trigger-rebuild:
name: 'Trigger rebuild' name: "Trigger rebuild"
runs-on: 'ubuntu-latest' runs-on: "ubuntu-latest"
permissions: permissions:
contents: 'read' contents: "read"
steps: steps:
- name: 'REST API call' - name: "REST API call"
env: env:
GITHUB_PAT: '${{ secrets.PERSONAL_GITHUB_TOKEN }}' GITHUB_PAT: "${{ secrets.PERSONAL_GITHUB_TOKEN }}"
run: | run: |
RELEASE_TAG="$(curl -fsS --proto '=https' --tlsv1.3 --globoff \ RELEASE_TAG="$(curl -fsS --proto '=https' --tlsv1.3 --globoff \
--url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/releases/latest" \ --url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/releases/latest" \