55 lines
1.7 KiB
YAML
Executable File
55 lines
1.7 KiB
YAML
Executable File
name: release
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
env:
|
|
ASPNETCORE_ENVIRONMENT: Production
|
|
|
|
jobs:
|
|
docker:
|
|
name: Build and push Docker image
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
with:
|
|
install: true
|
|
- name: Log in to Container registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: git.mahdium.ir
|
|
username: ${{ secrets.USERNAME }}
|
|
password: ${{ secrets.PASSWORD }}
|
|
# - name: Cache Docker layers
|
|
# id: cache-layers
|
|
# uses: actions/cache@v3
|
|
# with:
|
|
# path: /tmp/.buildx-cache
|
|
# key: ${{ runner.os }}-buildx-${{ github.ref }}-${{ github.sha }}
|
|
# restore-keys: |
|
|
# ${{ runner.os }}-buildx-${{ github.ref }}-
|
|
# ${{ runner.os }}-buildx-
|
|
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: git.mahdium.ir/mahdium/cats-of-mastodon-telegram-bot
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
push: true
|
|
<<<<<<< HEAD
|
|
tags: "git.mahdium.ir/mahdium/cats-of-mastodon-telegram-bot${{gitea.sha}},git.mahdium.ir/mahdium/cats-of-mastodon-telegram-bot:latest"
|
|
=======
|
|
tags: tags: "git.mahdium.ir/mahdium/cats-of-mastodon-telegram-bot${{gitea.sha}},git.mahdium.ir/mahdium/cats-of-mastodon-telegram-bot:latest"
|
|
>>>>>>> fdc5ee9728343b2a78ae9a0275c53824d9336f91
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=registry,ref=user/app:latest
|
|
cache-to: type=inline
|