Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions .github/workflows/flannel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,37 @@ permissions:
on:
push:
branches: [ flannel ]

workflow_dispatch:
inputs:
branch:
description: 'tag'
required: true
default: 'main'
env:
PROJECT: flannel
BRANCH: v0.26.4
REGISTRY_NAME: "${{ secrets.MY_HUB_NAME }}"
REGISTRY_USER: "${{ secrets.MY_HUB_USER }}"
REGISTRY_PASS: "${{ secrets.MY_HUB_PASSWORD }}"
Dockerfile: Dockerfile-flannel
BUILDX_NO_DEFAULT_ATTESTATIONS: 1

jobs:
build:
name: Build
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Getting image tag
id: tag
run: |
echo "trigger by ${{ github.event_name }}"
echo "sha256 is ${{ github.sha }}"

if ${{ github.event_name == 'workflow_dispatch' }} ; then
echo "vbranch=${{ github.event.inputs.branch }}" >> $GITHUB_ENV
else
echo "vbranch=${{ env.BRANCH }}" >> $GITHUB_ENV
fi
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- uses: docker/login-action@v2
Expand All @@ -31,24 +48,26 @@ jobs:
uses: actions/checkout@v4
with:
repository: flannel-io/flannel
ref: ${{ env.BRANCH }}
ref: ${{ env.vbranch }}
path: ${{ env.PROJECT }}

- name: Docker Buildx (push)
run: |
cd ${{ env.PROJECT }}
docker buildx build \
--no-cache \
--provenance false --sbom false \
--platform linux/amd64 \
--build-arg VERSION=${{ env.BRANCH }} \
--build-arg VERSION=${{ env.vbranch }} \
--output "type=image,push=true" \
--tag ${{ env.REGISTRY_NAME }}/captain/flannel:${{ env.BRANCH }} \
--tag ${{ env.REGISTRY_NAME }}/captain/flannel:${{ env.vbranch }} \
--file ../${{ env.Dockerfile }} ./

docker buildx build \
--no-cache \
--provenance false --sbom false \
--platform linux/arm64 \
--build-arg VERSION=${{ env.BRANCH }} \
--build-arg VERSION=${{ env.vbranch }} \
--output "type=image,push=true" \
--tag ${{ env.REGISTRY_NAME }}/arm64v8/flannel:${{ env.BRANCH }} \
--tag ${{ env.REGISTRY_NAME }}/arm64v8/flannel:${{ env.vbranch }} \
--file ../${{ env.Dockerfile }} ./