67 lines
1.9 KiB
YAML
67 lines
1.9 KiB
YAML
name: Build and push image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build-containers:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DOCKER_ORG: eising
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Docker BuildX
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Login to Registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: git.eising.cloud # replace it with your local IP
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.MY_GITEA_TOKEN }}
|
|
|
|
- name: Get Meta
|
|
id: meta
|
|
run: |
|
|
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
|
echo ${{ gitea.actor }}
|
|
echo ${{ gitea.token }}
|
|
|
|
- name: Build backend and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: ./docker/Dockerfile.backend
|
|
platforms: |
|
|
linux/amd64
|
|
push: true
|
|
tags: |
|
|
git.eising.cloud/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}-backend:${{ gitea.ref == 'refs/heads/main' && 'latest' || gitea.sha }}
|
|
|
|
|
|
- name: Build sshd and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: ./docker/Dockerfile.sshd
|
|
platforms: |
|
|
linux/amd64
|
|
push: true
|
|
tags: |
|
|
git.eising.cloud/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}-sshd:${{ gitea.ref == 'refs/heads/main' && 'latest' || gitea.sha }}
|
|
|
|
- name: Build admin and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: ./docker/Dockerfile.admin
|
|
platforms: |
|
|
linux/amd64
|
|
push: true
|
|
tags: |
|
|
git.eising.cloud/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}-admin:${{ gitea.ref == 'refs/heads/main' && 'latest' || gitea.sha }}
|