mirror of
https://github.com/valitydev/limiter.git
synced 2024-11-06 09:05:17 +00:00
f577d1292a
* Switch to valitydev upstreams * valitydev/thrift_erlang@c280ff2 * valitydev/scoper@7f3183d * valitydev/genlib@82c5ff3 * valitydev/erlang-health@5958e2f * valitydev/damsel@1d60b20 * Drop how_are_you
54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
name: Build Docker image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
- 'epic/**'
|
|
pull_request:
|
|
branches: ['**']
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
# 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: Log in to the Container registry
|
|
uses: docker/login-action@v1.12.0
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Construct tags / labels for an image
|
|
id: meta
|
|
uses: docker/metadata-action@v3.6.2
|
|
with:
|
|
images: |
|
|
${{ env.REGISTRY }}/${{ github.repository }}
|
|
tags: |
|
|
type=sha
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v2.9.0
|
|
with:
|
|
push: ${{ github.event_name == 'push' }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
build-args: |
|
|
SERVICE_NAME=${{ env.SERVICE_NAME }}
|
|
OTP_VERSION=${{ env.OTP_VERSION }}
|
|
THRIFT_VERSION=${{ env.THRIFT_VERSION }}
|