Skip to content

feat: Introduce GitHub Action #4

feat: Introduce GitHub Action

feat: Introduce GitHub Action #4

name: buildenvs/github-action
on:
push:
branches: [stable]
pull_request:
types: [opened, synchronize, reopened]
branches: [staging]
paths:
- 'tools/github-action/**'
- '.github/workflows/github-action-build.yaml'
jobs:
github-action:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to OCI registry
uses: docker/login-action@v2
if: ${{ github.event_name == 'push' }}
with:
registry: index.unikraft.io
username: ${{ secrets.REG_USERNAME }}
password: ${{ secrets.REG_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: ${{ github.event_name == 'push' }}
tags: index.unikraft.io/kraftkit.sh/github-action:v0
platforms: linux/amd64
secrets: |
GIT_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }}