Skip to content

Commit

Permalink
Merge branch 'main' into ci/split-workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Raines authored Jun 10, 2021
2 parents 3431429 + b7d67dd commit 83222b2
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Build and push development images
name: Build and push 1.x images

on:
push:
branches:
- 'main-test'
- 'main'
- 'next'
tags:
- '*'
- '1.*'
- 'v1.*'

jobs:
docker:
Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/2x-docker-build-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build and push 2.x images

on:
push:
branches:
- 'main'
- 'next'
tags:
- '2.*'
- 'v2.*'

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Parse semver string
id: semver_parser
if: ${{ contains(github.ref, 'tags') }}
uses: booxmedialtd/ws-action-parse-semver@v1
with:
input_string: ${{ github.ref }}
version_extractor_regex: 'refs\/tags\/(.*)$'
- name: Add Railgun standard tags
run: |
echo 'RAILGUN_STANDARD<<EOF' >> $GITHUB_ENV
echo 'type=ref,event=branch,suffix=-railgun' >> $GITHUB_ENV
echo 'type=semver,pattern={{version}}' >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Add Railgun major.minor tag
if: ${{ steps.semver_parser.outputs.prerelease == '' }}
run: |
echo 'RAILGUN_SUPPLEMENTAL<<EOF' >> $GITHUB_ENV
echo "" >> $GITHUB_ENV
echo 'type=semver,pattern={{major}}.{{minor}}' >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2.1.6
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Docker meta (railgun)
id: meta_railgun
uses: docker/metadata-action@v3.3.0
with:
images: kong/kubernetes-ingress-controller
flavor: |
latest=false
tags: ${{ env.RAILGUN_STANDARD }}${{ env.RAILGUN_SUPPLEMENTAL }}
- name: Build binary
env:
TAG: ${{ steps.meta_railgun.outputs.version }}
COMMIT: ${{ github.sha }}
REPO_INFO: https://github.com/${{ github.repository }}.git
id: docker_build_binary
uses: docker/build-push-action@v2
with:
push: false
file: Dockerfile.railgun
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
target: builder
- name: Build and push Railgun
id: docker_build_railgun
env:
TAG: ${{ steps.meta_railgun.outputs.version }}
uses: docker/build-push-action@v2
with:
push: true
file: Dockerfile.railgun
tags: ${{ steps.meta_railgun.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache

0 comments on commit 83222b2

Please sign in to comment.