Skip to content

[SYSE-370 release-5.3] June template application #4020

[SYSE-370 release-5.3] June template application

[SYSE-370 release-5.3] June template application #4020

---
name: Plugin-compiler build
on:
pull_request:
push:
branches:
- master
- release-**
tags:
- 'v*'
env:
GOLANG_CROSS: 1.21-bullseye
jobs:
docker-build:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS Credentials
id: configure-aws
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::754489498669:role/ecr_rw_tyk
role-session-name: ci-plugin-compiler-push
aws-region: eu-central-1
- name: Login to AWS ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Set docker metadata
id: set-metadata
uses: docker/metadata-action@v4
with:
images: |
tykio/tyk-plugin-compiler,enable=${{ startsWith(github.ref, 'refs/tags') }}
${{ steps.login-ecr.outputs.registry }}/tyk-plugin-compiler
labels: |
org.opencontainers.image.title=tyk-plugin-compiler
org.opencontainers.image.description=Plugin compiler for the Tyk API Gateway
tags: |
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern={{raw}}
type=sha,format=long
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push to dockerhub/ECR
uses: docker/build-push-action@v4
with:
context: .
file: ci/images/plugin-compiler/Dockerfile
platforms: linux/amd64
push: true
labels: ${{ steps.set-metadata.outputs.labels }}
tags: ${{ steps.set-metadata.outputs.tags }}
build-args: |
BASE-IMAGE=tykio/golang-cross:${{ env.GOLANG_CROSS }}
GITHUB_SHA=${{ github.sha }}
GITHUB_TAG=${{ github.ref_name }}