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: release flannel and upload docker images | |
on: | |
release: | |
types: [published] | |
env: | |
GO_VERSION: "1.21" | |
LINUX_ARCHES: "amd64 arm arm64 s390x ppc64le riscv64" | |
REPOSITORY: flannel/flannel | |
jobs: | |
build-and-push-images: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: set tag | |
run: echo "GIT_TAG=$(git describe --tags --always)" >> $GITHUB_ENV | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: go mod vendor | |
run: go mod vendor | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REPOSITORY }} | |
flavor: latest=false | |
tags: | | |
type=ref,event=tag | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push Docker image | |
if: github.repository_owner == 'flannel-io' && success() | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: images/Dockerfile | |
push: true | |
platforms: linux/amd64,linux/arm64,linux/arm,linux/s390x,linux/ppc64le,linux/riscv64 | |
tags: ${{ steps.meta.outputs.tags }} | |
build-args: TAG=${{ env.GIT_TAG }} | |
build-and-push-artifacts: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
pages: write | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: go mod vendor | |
run: go mod vendor | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Build release artifacts | |
run: make release | |
- name: Upload release files | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dist/flannel* | |
dist/kube-flannel.yml | |
dist/kube-flannel-psp.yml | |
- name: Wait for previous job | |
uses: yogeshlonkar/[email protected] | |
with: | |
jobs: build-and-push-images | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'chart/' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |