Skip to content

Списки модераторов и ведущих вынесены в конфиг #45

Списки модераторов и ведущих вынесены в конфиг

Списки модераторов и ведущих вынесены в конфиг #45

Workflow file for this run

name: Go
on:
push:
branches: [ main ]
paths-ignore:
- '**/README.md'
- '.github/**'
pull_request:
branches: [ main ]
paths-ignore:
- '**/README.md'
- '.github/**'
env:
REGISTRY: ghcr.io/terratensor
REGISTRY_HOST: ghcr.io
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker Login
uses: azure/docker-login@v1
with:
login-server: ${{ env.REGISTRY_HOST }}
username: audetv
password: ${{ github.token }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22.2
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
- name: Inject branch slug
uses: rlespinasse/github-slug-action@v3.x
- name: Set image tag
run: echo "::set-env name=IMAGE_TAG::${{ env.GITHUB_REF_SLUG }}-${GITHUB_RUN_NUMBER}"
- name: Build
run: make docker-build
- name: Push
run: make push
if: ${{ github.ref == 'refs/heads/main' }}
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.PRODUCTION_KEY }}
known_hosts: ${{ secrets.PRODUCTION_HOST }}
if: ${{ github.ref == 'refs/heads/main' }}
- name: Deploy
run: make deploy
env:
BUILD_NUMBER: ${GITHUB_RUN_NUMBER}
HOST: ${{ secrets.PRODUCTION_HOST }}
PORT: ${{ secrets.PRODUCTION_PORT }}
if: ${{ github.ref == 'refs/heads/main' }}