Skip to content

self-hosted uhh

self-hosted uhh #71

Workflow file for this run

name: Build test project
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
PROJECT_NAME: test
jobs:
init:
runs-on: self-hosted
strategy:
matrix:
target:
- go_builder
steps:
- uses: TooMuch4U/[email protected]
- uses: actions/checkout@v4
with:
submodules: true
- run: |
CURRENT_BUILD_NAME = ${{ PROJECT_NAME }}_base:${{ matrix.target }}
docker build -f ./base.Dockerfile \
-t ${{ CURRENT_BUILD_NAME }} \
--target ${{ matrix.target }} \
--tag base:${{ matrix.target }}
--cache-from type=gha,scope=${{ CURRENT_BUILD_NAME }} \
--cache-to type=gha,mode=max,scope=${{ CURRENT_BUILD_NAME }} \
.
# - name: Preparing builder - ${{ matrix.target }}
# uses: docker/build-push-action@v3
# with:
# file: ./base.Dockerfile
# context: .
# tags: base:${{ matrix.target }}
# target: ${{ matrix.target }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
# load: true
backend:
runs-on: self-hosted
permissions:
contents: read
packages: write
needs:
- init
strategy:
matrix:
target:
- pingserver
steps:
- uses: TooMuch4U/[email protected]
- name: Log into github packages
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u "${{ github.actor }}" --password-stdin
- uses: actions/checkout@v4
# - name: Preparing builder - ${{ matrix.target }}
# uses: docker/build-push-action@v3
# with:
# file: ./apps/${{ matrix.target }}/Dockerfile
# context: .
# tags: docker.pkg.github.com/${{ github.repository }}/meow-${{ matrix.target }}:latest
# cache-from: type=gha
# cache-to: type=gha,mode=max
## load: true
# build-args: PATH_TO_MAIN=./apps/${{ matrix.target }}
# push: true

Check failure on line 74 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build.yml

Invalid workflow file

You have an error in your yaml syntax on line 74
- name: Start build ${{ PROJECT_NAME }} - ${{ matrix.target }}
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/${{ PROJECT_NAME }}-${{ matrix.target }}
echo START BUILD WITH IMAGE_ID=$IMAGE_ID
PATH_TO_MAIN=./apps/${{ matrix.target }}
echo PATH_TO_MAIN=$PATH_TO_MAIN
docker build -f $PATH_TO_MAIN/Dockerfile \
--build-arg PATH_TO_MAIN=$PATH_TO_MAIN \
--tag $IMAGE_ID:latest \
# --cache-from type=gha \
# --cache-to type=gha,mode=max \
-t ${{ PROJECT_NAME }}:${{ matrix.target }} \
.
docker push $IMAGE_ID:latest