chore(deps): update pre-commit hook renovatebot/pre-commit-hooks to v37.31.3 #876
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: 'OPI SZTP CI' | |
on: | |
workflow_dispatch: | |
workflow_call: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
sztp-server-push: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3.0.0 | |
- name: Log in to the GH Container registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3.0.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5.0.0 | |
with: | |
images: ghcr.io/${{ github.repository_owner }}/opi-sztp-server | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@v5.0.0 | |
with: | |
context: sztp-server | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
sztp-client-push: | |
needs: sztp-server-push | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3.0.0 | |
- name: Log in to Docker Hub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3.0.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Log in to the GH Container registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3.0.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5.0.0 | |
with: | |
images: | | |
${{ github.repository }} | |
ghcr.io/${{ github.repository_owner }}/opi-sztp-client | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@v5.0.0 | |
with: | |
context: sztp-agent | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
sztp-ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
# Workaround: https://github.com/docker/build-push-action/issues/461 | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@dedd61cf5d839122591f5027c89bf3ad27691d18 | |
- name: Start containers | |
run: docker-compose up -d | |
- name: Run Tests | |
run: ./scripts/tests.sh | |
- name: Logs | |
if: failure() | |
run: docker-compose logs | |
- name: Stop containers | |
if: always() | |
run: docker-compose down |