Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/deploy-tap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
permissions:
contents: write
pull-requests: write
environment:
name: homebrew
url: https://github.com/MFlowCode/homebrew-mfc
steps:
- name: Checkout MFC repository
uses: actions/checkout@v4
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ jobs:
fi
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "TAG=$TAG" >> $GITHUB_ENV
OWNER="${{ github.repository_owner }}"
echo "GH_REGISTRY=ghcr.io/${OWNER,,}/mfc" >> $GITHUB_ENV
git clone --branch "$BRANCH" --depth 1 ${{ github.server_url }}/${{ github.repository }}.git mfc

- name: Stage
Expand Down Expand Up @@ -107,7 +109,7 @@ jobs:
org.opencontainers.image.source=https://github.com/${{ github.repository }}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-${{ matrix.config.name }}-${{ matrix.config.runner }}
ghcr.io/${{ github.repository_owner }}/mfc:${{ env.TAG }}-${{ matrix.config.name }}-${{ matrix.config.runner }}
${{ env.GH_REGISTRY }}:${{ env.TAG }}-${{ matrix.config.name }}-${{ matrix.config.runner }}
push: true

- name: Build and push image (gpu)
Expand All @@ -129,12 +131,15 @@ jobs:
org.opencontainers.image.source=https://github.com/${{ github.repository }}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-${{ matrix.config.name }}-${{ matrix.config.runner }}
ghcr.io/${{ github.repository_owner }}/mfc:${{ env.TAG }}-${{ matrix.config.name }}-${{ matrix.config.runner }}
${{ env.GH_REGISTRY }}:${{ env.TAG }}-${{ matrix.config.name }}-${{ matrix.config.runner }}
push: true

manifests:
runs-on: ubuntu-latest
needs: Container
environment:
name: containers
url: https://hub.docker.com/r/${{ secrets.DOCKERHUB_USERNAME }}/mfc
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
Expand All @@ -152,12 +157,17 @@ jobs:
- name: Setup Buildx
uses: docker/setup-buildx-action@v3

- name: Set GHCR registry (lowercase)
run: |
OWNER="${{ github.repository_owner }}"
echo "GH_REGISTRY=ghcr.io/${OWNER,,}/mfc" >> $GITHUB_ENV

- name: Create and Push Manifest Lists
env:
TAG: ${{ needs.Container.outputs.tag }}
DH: ${{ secrets.DOCKERHUB_USERNAME }}/mfc
GH: ghcr.io/${{ github.repository_owner }}/mfc
run: |
GH="${{ env.GH_REGISTRY }}"
for R in "$DH" "$GH"; do
docker buildx imagetools create -t $R:$TAG-cpu $R:$TAG-cpu-ubuntu-22.04 $R:$TAG-cpu-ubuntu-22.04-arm
docker buildx imagetools create -t $R:$TAG-gpu $R:$TAG-gpu-ubuntu-22.04 $R:$TAG-gpu-ubuntu-22.04-arm
Expand All @@ -168,8 +178,8 @@ jobs:
env:
TAG: ${{ needs.Container.outputs.tag }}
DH: ${{ secrets.DOCKERHUB_USERNAME }}/mfc
GH: ghcr.io/${{ github.repository_owner }}/mfc
run: |
GH="${{ env.GH_REGISTRY }}"
for R in "$DH" "$GH"; do
docker buildx imagetools create -t $R:latest-cpu $R:$TAG-cpu-ubuntu-22.04 $R:$TAG-cpu-ubuntu-22.04-arm
docker buildx imagetools create -t $R:latest-gpu $R:$TAG-gpu-ubuntu-22.04 $R:$TAG-gpu-ubuntu-22.04-arm
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
pull_request:

jobs:
docs:
name: Build & Publish
build:
name: Build & Verify
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -73,21 +73,38 @@
args: -c .lychee.toml build/install/docs/mfc/
fail: true

publish:
name: Publish
runs-on: ubuntu-latest
needs: build
if: github.repository == 'MFlowCode/MFC' && github.ref == 'refs/heads/master' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
environment:
name: docs
url: https://mflowcode.github.io/

steps:
- uses: actions/checkout@v4

- name: Download Built Documentation Artifact
uses: actions/download-artifact@v4
with:
name: mfc-docs
path: build/install/docs/mfc

- name: Publish Documentation
if: github.repository == 'MFlowCode/MFC' && github.ref == 'refs/heads/master' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' )
run: |
set +e
git ls-remote "${{ secrets.DOC_PUSH_URL }}" -q
if [ "$?" -ne "0" ]; then exit 0; fi
set -e
git config --global user.name 'MFC Action'
git config --global user.email '<>'
git clone "${{ secrets.DOC_PUSH_URL }}" ../www
rm -rf ../www/*
mv build/install/docs/mfc/* ../www/
git -C ../www add -A
git -C ../www commit -m "Docs @ ${GITHUB_SHA::7}" || true
git -C ../www push

# DOC_PUSH_URL should be of the format:
# --> https://<username>:<token>@github.com/<username>/<repository>

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
3 changes: 3 additions & 0 deletions .github/workflows/homebrew-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
update-homebrew-tap:
name: Update homebrew-mfc tap
runs-on: ubuntu-latest
environment:
name: homebrew
url: https://github.com/MFlowCode/homebrew-mfc

steps:
- name: Determine version
Expand Down
Loading