Skip to content

Add dockerhub login to prevent ratelimit of CI #156

Add dockerhub login to prevent ratelimit of CI

Add dockerhub login to prevent ratelimit of CI #156

Workflow file for this run

name: CI tests
on:
workflow_call:
push:
branches:
- main
- release/v[0-9]+.(0|x)
- release/v[0-9]+.[0-9]+.(0|x)
- release/v[0-9]+.[0-9]+.[0-9]+
paths-ignore:
- 'docs/**'
- '*.md'
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PUBLIC_REGISTRY: ghcr.io
jobs:
ci:
permissions:
contents: write # Upload artefacts to release.
# write is needed for:
# - OIDC for cosign's use in ecm-distro-tools/publish-image.
# - Read vault secrets in rancher-eio/read-vault-secrets.
id-token: write
packages: write
attestations: write
runs-on: runs-on,runner=2cpu-linux-x64,run-id=${{ github.run_id }}
steps:
- name: Check out repository code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Load Secrets from Vault
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials username | DOCKER_USERNAME ;
secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials password | DOCKER_PASSWORD ;
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
-
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3
- name: Basic CI
run: make ci
- name: Upload CI files to artifacts (on failure)
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: failure()
with:
path: 'ci'
retention-days: 7