mirror of
https://github.com/valitydev/bouncer.git
synced 2024-11-06 10:25:19 +00:00
af42521899
* TD-187: Add CI/CD * Fix specs * Fix tests * Review fixes
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
name: Build Docker image
|
|
on:
|
|
pull_request:
|
|
branches: ["*"]
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Construct tags / labels for an image
|
|
id: meta
|
|
uses: docker/metadata-action@v3
|
|
with:
|
|
images: |
|
|
${{ env.REGISTRY }}/${{ github.repository }}
|
|
tags: |
|
|
type=sha
|
|
|
|
# https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable
|
|
- name: Update environment variables
|
|
run: grep -v '^#' .env >> $GITHUB_ENV
|
|
|
|
- name: Setup Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Build Docker image
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
push: false
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
build-args: |
|
|
OTP_VERSION=${{ env.OTP_VERSION }}
|
|
THRIFT_VERSION=${{ env.THRIFT_VERSION }}
|
|
SERVICE_NAME=${{ env.SERVICE_NAME }}
|