Skip to content
Snippets Groups Projects
Commit 7842df39 authored by Emmanuel Bruno's avatar Emmanuel Bruno
Browse files

fixes qemu CI.

parent 486d1a35
No related branches found
No related tags found
No related merge requests found
name: ci name: Multi Arch Bare Metal CI
on: on:
workflow_dispatch: workflow_dispatch:
push: # push:
branches: # branches:
- 'releases/v*' # - 'releases/v*'
- 'develop' # - 'develop'
tags: # tags:
- 'v*.*.*' # - 'v*.*.*'
concurrency: concurrency:
group: ${{ github.ref }} group: ${{ github.ref }}
......
name: Multi Arch Bare Metal CI
on:
workflow_dispatch:
push:
branches:
- 'releases/v*'
- 'develop'
tags:
- 'v*.*.*'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
docker:
runs-on: [self-hosted, qemu]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set the environment variable
run: echo REPOSITORY_NAME=${GITHUB_REPOSITORY#*\/} >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
"${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPOSITORY_NAME }}"
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
labels: |
org.opencontainers.image.description=A test for Docker CI with Github Actions.
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Private registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ secrets.PRIVATEHUB_HOSTNAME }}
username: ${{ secrets.PRIVATEHUB_USERNAME }}
password: ${{ secrets.PRIVATEHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
config-inline: |
[registry."docker.io"]
mirrors = ["${{ secrets.DOCKERHUB_PROXY_HOSTNAME }}"]
[registry."${{ secrets.PRIVATEHUB_HOSTNAME }}"]
http = true
insecure = true
driver-opts: |
network=host
buildkitd-flags: |
--debug
--allow-insecure-entitlement network.host
--allow-insecure-entitlement security.insecure
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64/v8
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ secrets.PRIVATEHUB_HOSTNAME }}/${{ env.REPOSITORY_NAME }}:buildcache
cache-to: type=registry,ref=${{ secrets.PRIVATEHUB_HOSTNAME }}/${{ env.REPOSITORY_NAME }}:buildcache,mode=min,compression=zstd
- name: Update repo description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: "${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPOSITORY_NAME }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment