mirror of
https://github.com/valitydev/fistful-server.git
synced 2024-11-06 02:35:18 +00:00
TD-222: Reuse valitydev/action-deploy-docker@v2 (#37)
This commit is contained in:
parent
985b51f5f0
commit
be7b968d57
54
.github/workflows/build-and-push-image.yaml
vendored
54
.github/workflows/build-and-push-image.yaml
vendored
@ -1,54 +0,0 @@
|
|||||||
name: Build and push Docker image
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: ['master']
|
|
||||||
|
|
||||||
env:
|
|
||||||
REGISTRY: ghcr.io
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v1
|
|
||||||
|
|
||||||
- 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
|
|
||||||
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
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
${{ env.REGISTRY }}/${{ github.repository }}
|
|
||||||
tags: |
|
|
||||||
type=sha
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
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 }}
|
|
40
.github/workflows/build-image.yaml
vendored
40
.github/workflows/build-image.yaml
vendored
@ -1,40 +0,0 @@
|
|||||||
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@v3
|
|
||||||
- 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: Construct tags / labels for an image
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v3
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
${{ env.REGISTRY }}/${{ github.repository }}
|
|
||||||
tags: |
|
|
||||||
type=sha
|
|
||||||
- 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 }}
|
|
21
.github/workflows/build-image.yml
vendored
Normal file
21
.github/workflows/build-image.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
name: Build and publish Docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
- 'epic/**'
|
||||||
|
pull_request:
|
||||||
|
branches: ['**']
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: ghcr.io
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: valitydev/action-deploy-docker@v2
|
||||||
|
with:
|
||||||
|
registry-username: ${{ github.actor }}
|
||||||
|
registry-access-token: ${{ secrets.GITHUB_TOKEN }}
|
Loading…
Reference in New Issue
Block a user