Skip to content

Workflow file for this run

name: Create and publish image
on:
push:
branches:
- '**' # Слушаем все ветки
env:
REGISTRY: ghcr.io
IMAGE_NAME: airdao-gov-user-binary
jobs:
build_and_publish_binary:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v3
id: meta
with:
images: ${{ env.REGISTRY }}/ambrosus/${{ env.IMAGE_NAME }}
tags: |
type=sha,format=long
type=ref,event=branch
type=raw,value=${{ github.ref_name }}
# - name: Build and push
# uses: docker/build-push-action@v2
# with:
# file: Dockerfile_binary
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=local,src=/tmp/.buildx-cache
# cache-to: type=local,dest=/tmp/.buildx-cache-new
# - name: Move cache
# run: |
# rm -rf /tmp/.buildx-cache
# mv /tmp/.buildx-cache-new /tmp/.buildx-cache
build_and_publish_db:
needs: build_and_publish_binary
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v3
id: meta
with:
images: ghcr.io/ambrosus/airdao-gov-portal-db
tags: |
type=sha,format=long
type=ref,event=branch
type=raw,value=${{ github.ref_name }}
- name: Generate temporary Dockerfile
run: |
sed 's/${BRANCH}/'${{ github.ref_name }}'/g' Dockerfile_db > $GITHUB_WORKSPACE/Dockerfile_temp_db
- name: Build and push
uses: docker/build-push-action@v2
with:
file: ${{ github.workspace }}/Dockerfile_temp_db
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
build_and_publish_verifier:
needs: build_and_publish_binary
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v3
id: meta
with:
images: ghcr.io/ambrosus/airdao-gov-user-verifier
tags: |
type=sha,format=long
type=ref,event=branch
type=raw,value=${{ github.ref_name }}
- name: Generate temporary Dockerfile
run: |
sed 's/${BRANCH}/'${{ github.ref_name }}'/g' Dockerfile_verifier > $GITHUB_WORKSPACE/Dockerfile_temp_verifier
- name: Build and push
uses: docker/build-push-action@v2
with:
file: Dockerfile_temp_verifier
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
build_and_publish_mailer:
needs: build_and_publish_binary
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v3
id: meta
with:
images: ghcr.io/ambrosus/airdao-gov-user-mailer
tags: |
type=sha,format=long
type=ref,event=branch
type=raw,value=${{ github.ref_name }}
- name: Generate temporary Dockerfile
run: |
sed 's/${BRANCH}/'${{ github.ref_name }}'/g' Dockerfile_mailer > $GITHUB_WORKSPACE/Dockerfile_temp_mailer
- name: Build and push
uses: docker/build-push-action@v2
with:
file: Dockerfile_temp_mailer
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache