Skip to content

Commit

Permalink
Create ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dongjiang1989 authored Nov 13, 2022
1 parent ccc60b7 commit 0fced31
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Docker publish

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:

push:
branches: [ "main" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]


defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'

jobs:
generate-jobs:
name: customlimitrange-manager-build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
-
name: customlimitrange-manager
image: dongjiang1989/customlimitrange-manager:latest
file: ./hack/build/Dockerfile
platforms: linux/amd64,linux/arm64

steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v3
with:
file: ${{ matrix.file }}
platforms: ${{ matrix.platforms }}
push: true
tags: ${{ matrix.image }}
- name: Test ${{ matrix.name }}
run: |
docker pull ${{ matrix.image}}:${{ matrix.name }}
docker image inspect ${{ matrix.image}}:${{ matrix.name }}

0 comments on commit 0fced31

Please sign in to comment.