Skip to content

initial commit

initial commit #20

name: devcontainer build and push release
on:
workflow_dispatch:
pull_request:
branches:
- "main"
- "staging"
push:
tags:
- "v*.*.*"
branches:
- "main"
- "staging"
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
directory: ['unity-2022/2022.3.11f1']
steps:
- name: checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: login ghcr
id: login_ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: ${{ matrix.directory }} - check diff changes
id: check_diff_changes
run: |
if git diff --quiet HEAD^ HEAD -- ${{ matrix.directory }}; then
echo "[${{ matrix.directory }}] didn't find changes"
echo "::set-output name=changed::false"
else
echo "[${{ matrix.directory }}] found changes"
echo "::set-output name=subfolder::${{ matrix.directory }}"
echo "::set-output name=changed::true"
fi
- name: ${{ matrix.directory }} - prebuild unity
id: prebuild_unity
uses: devcontainers/ci@v0.3
if: steps.check_diff_changes.outputs.changed == 'true'
with:
subfolder: ${{ steps.check_diff_changes.outputs.subfolder }}
imageName: ghcr.io/${{ github.repository }}/${{ steps.check_diff_changes.outputs.subfolder }}
cacheFrom: ghcr.io/${{ github.repository }}/${{ steps.check_diff_changes.outputs.subfolder }}
refFilterForPush: "refs/heads/main"
push: filter