2020-03-15 20:10:38 +00:00
|
|
|
name: Docker image
|
2020-03-15 08:35:34 +00:00
|
|
|
|
2020-03-15 19:28:09 +00:00
|
|
|
on:
|
|
|
|
push:
|
2020-06-10 16:48:54 +00:00
|
|
|
tags:
|
2021-01-23 09:33:20 +00:00
|
|
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
2022-09-28 18:47:32 +00:00
|
|
|
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
|
|
|
|
- 'v[0-9]+.[0-9]+.[0-9]+-docker.[0-9]+'
|
2020-03-15 08:35:34 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-03-06 18:11:47 +00:00
|
|
|
os: [ubuntu-22.04]
|
2020-03-15 08:35:34 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Context
|
|
|
|
env:
|
|
|
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
|
|
run: echo "$GITHUB_CONTEXT"
|
2021-09-28 06:15:08 +00:00
|
|
|
- uses: actions/checkout@v2
|
2020-03-15 08:35:34 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
2022-09-28 18:47:32 +00:00
|
|
|
|
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v4
|
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
dbgate/dbgate
|
|
|
|
flavor: |
|
|
|
|
latest=false
|
|
|
|
tags: |
|
|
|
|
type=raw,value=beta,enable=${{ contains(github.ref_name, '-docker.') || contains(github.ref_name, '-beta.') }}
|
|
|
|
|
|
|
|
type=match,pattern=\d+.\d+.\d+,enable=${{ !contains(github.ref_name, '-docker.') && !contains(github.ref_name, '-beta.') }}
|
|
|
|
type=raw,value=latest,enable=${{ !contains(github.ref_name, '-docker.') && !contains(github.ref_name, '-beta.') }}
|
|
|
|
|
|
|
|
- name: Docker alpine meta
|
|
|
|
id: alpmeta
|
|
|
|
uses: docker/metadata-action@v4
|
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
dbgate/dbgate
|
|
|
|
flavor: |
|
|
|
|
latest=false
|
|
|
|
tags: |
|
|
|
|
type=raw,value=beta-alpine,enable=${{ contains(github.ref_name, '-docker.') || contains(github.ref_name, '-beta.') }}
|
|
|
|
|
|
|
|
type=match,pattern=\d+.\d+.\d+,suffix=-alpine,enable=${{ !contains(github.ref_name, '-docker.') && !contains(github.ref_name, '-beta.') }}
|
|
|
|
type=raw,value=alpine,enable=${{ !contains(github.ref_name, '-docker.') && !contains(github.ref_name, '-beta.') }}
|
|
|
|
|
2023-12-24 04:35:40 +00:00
|
|
|
- name: Use Node.js 16.x
|
2020-03-15 08:35:34 +00:00
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
2023-12-24 04:35:40 +00:00
|
|
|
node-version: 16.x
|
2020-03-15 08:35:34 +00:00
|
|
|
- name: yarn install
|
|
|
|
run: |
|
2022-09-28 18:47:32 +00:00
|
|
|
# yarn --version
|
|
|
|
# yarn config set network-timeout 300000
|
2020-03-15 08:35:34 +00:00
|
|
|
yarn install
|
2020-12-10 12:31:37 +00:00
|
|
|
- name: setCurrentVersion
|
|
|
|
run: |
|
|
|
|
yarn setCurrentVersion
|
2020-03-15 20:10:38 +00:00
|
|
|
- name: Prepare docker image
|
2020-03-15 08:35:34 +00:00
|
|
|
run: |
|
2020-03-15 20:10:38 +00:00
|
|
|
yarn run prepare:docker
|
2022-09-28 18:47:32 +00:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
|
|
|
|
- name: Build and push
|
|
|
|
uses: docker/build-push-action@v3
|
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
context: ./docker
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
|
|
|
|
|
|
- name: Build and push alpine
|
|
|
|
uses: docker/build-push-action@v3
|
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
context: ./docker
|
|
|
|
file: ./docker/Dockerfile-alpine
|
|
|
|
tags: ${{ steps.alpmeta.outputs.tags }}
|
|
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|