Skip to content

Add build workflow #1

Add build workflow

Add build workflow #1

Workflow file for this run

name: build
on:
push:
branches: [ main ]
env:
DOCKER_BUILDKIT: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build and push the Docker image
shell: bash
run: |
short_sha=${GITHUB_SHA::7}
docker buildx create --name mybuilder --use
docker buildx build \
--platform=linux/arm64 \
-t "ghcr.io/g3rv4/telegramredirect-app:${short_sha}" \
-t ghcr.io/g3rv4/telegramredirect-app:latest \
-f ./app/Dockerfile \
--cache-from="type=registry,ref=ghcr.io/g3rv4/telegramredirect-app:latest-cache" \
--cache-to=type=registry,ref=ghcr.io/g3rv4/telegramredirect-app:latest-cache,mode=max \
--push \
app/ &
docker buildx build \
--platform=linux/arm64 \
-t "ghcr.io/g3rv4/telegramredirect-nginx:${short_sha}" \
-t ghcr.io/g3rv4/telegramredirect-nginx:latest \
-f ./nginx/Dockerfile \
--cache-from="type=registry,ref=ghcr.io/g3rv4/telegramredirect-nginx:latest-cache" \
--cache-to=type=registry,ref=ghcr.io/g3rv4/telegramredirect-nginx:latest-cache,mode=max \
--push \
nginx/ &