-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
84 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,50 +179,6 @@ | |
with: | ||
config: .yamllint | ||
|
||
lint-prettier: | ||
name: Prettier | ||
if: github.ref != 'refs/heads/main' && github.event_name == 'push' | ||
needs: information | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
folder: ${{ fromJson(needs.information.outputs.addon_dirs) }} | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/checkout@v4 | ||
- name: Debug - Print addon_dirs | ||
run: | | ||
echo "addon_dirs: ${{ needs.information.outputs.addon_dirs }}" | ||
- name: Debug - Print matrix folder path | ||
run: | | ||
echo "Matrix folder path: ${{ matrix.folder }}" | ||
- name: Run Prettier | ||
uses: creyD/[email protected] | ||
with: | ||
prettier_options: --write ./${{ matrix.folder }}/**/*.{json,js,md,yaml} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Commit and push changes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config --global user.name "github-actions" | ||
git config --global user.email "[email protected]" | ||
git add ./${{ matrix.folder }}/config.json ./${{ matrix.folder }}/build.json | ||
if ! git diff-index --quiet HEAD; then | ||
git commit -m "Prettified Code!" | ||
git fetch origin | ||
git rebase origin/${{ github.ref }} | ||
if [ $? -ne 0 ]; then | ||
echo "Rebase failed, attempting to resolve conflicts" | ||
git rebase --abort | ||
git pull origin ${{ github.ref }} | ||
fi | ||
git push https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:${{ github.ref }} | ||
else | ||
echo "No changes to commit" | ||
fi | ||
build_main_or_pr: | ||
name: Build ${{ matrix.architecture }} (Main or PR) | ||
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request') | ||
|
@@ -269,6 +225,12 @@ | |
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
- name: Compose build flags | ||
|
@@ -330,6 +292,7 @@ | |
BUILD_VERSION=${{ needs.information.outputs.version }} | ||
tags: | | ||
${{ secrets.DOCKER_USERNAME }}/${{ steps.convert.outputs.slug_lower }}:${{ steps.set_version.outputs.version }}-${{ matrix.architecture }} | ||
ghcr.io/${{ steps.convert.outputs.repository_owner_lower }}/${{ steps.convert.outputs.slug_lower }}:${{ steps.set_version.outputs.version }}-${{ matrix.architecture }} | ||
- name: Swap build cache | ||
run: | | ||
if [ -d /tmp/.docker-cache-new ]; then | ||
|
@@ -348,7 +311,6 @@ | |
- lint-json | ||
- lint-shellcheck | ||
- lint-yamllint | ||
- lint-prettier | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
|
@@ -390,6 +352,12 @@ | |
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
- name: Compose build flags | ||
|
@@ -451,6 +419,7 @@ | |
BUILD_VERSION=${{ needs.information.outputs.version }} | ||
tags: | | ||
${{ secrets.DOCKER_USERNAME }}/${{ steps.convert.outputs.slug_lower }}:${{ steps.set_version.outputs.version }}-${{ matrix.architecture }} | ||
ghcr.io/${{ steps.convert.outputs.repository_owner_lower }}/${{ steps.convert.outputs.slug_lower }}:${{ steps.set_version.outputs.version }}-${{ matrix.architecture }} | ||
- name: Swap build cache | ||
run: | | ||
if [ -d /tmp/.docker-cache-new ]; then | ||
|
@@ -476,7 +445,12 @@ | |
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create and Push Docker Manifest latest | ||
run: | | ||
IMAGE_NAME="${{ secrets.DOCKER_USERNAME }}/${{ needs.build_main_or_pr.outputs.slug_lower }}" | ||
|
@@ -494,6 +468,31 @@ | |
IMAGE_NAME="${{ secrets.DOCKER_USERNAME }}/${{ needs.build_main_or_pr.outputs.slug_lower }}" | ||
VERSION="${{ needs.build_main_or_pr.outputs.version }}" | ||
docker buildx imagetools create \ | ||
-t $IMAGE_NAME:$VERSION \ | ||
$IMAGE_NAME:$VERSION-amd64 \ | ||
$IMAGE_NAME:$VERSION-aarch64 \ | ||
$IMAGE_NAME:$VERSION-armhf \ | ||
$IMAGE_NAME:$VERSION-i386 \ | ||
$IMAGE_NAME:$VERSION-armv7 | ||
- name: Create and Push Docker Manifest latest to GHCR | ||
run: | | ||
IMAGE_NAME="ghcr.io/${{ needs.build_main_or_pr.outputs.repository_owner_lower }}/${{ needs.build_main_or_pr.outputs.slug_lower }}" | ||
VERSION="${{ needs.build_main_or_pr.outputs.version }}" | ||
docker buildx imagetools create \ | ||
-t $IMAGE_NAME:latest \ | ||
$IMAGE_NAME:$VERSION-amd64 \ | ||
$IMAGE_NAME:$VERSION-aarch64 \ | ||
$IMAGE_NAME:$VERSION-armhf \ | ||
$IMAGE_NAME:$VERSION-i386 \ | ||
$IMAGE_NAME:$VERSION-armv7 | ||
- name: Create and Push Docker Manifest Version to GHCR | ||
run: | | ||
IMAGE_NAME="ghcr.io/${{ needs.build_main_or_pr.outputs.repository_owner_lower }}/${{ needs.build_main_or_pr.outputs.slug_lower }}" | ||
VERSION="${{ needs.build_main_or_pr.outputs.version }}" | ||
docker buildx imagetools create \ | ||
-t $IMAGE_NAME:$VERSION \ | ||
$IMAGE_NAME:$VERSION-amd64 \ | ||
|
@@ -503,7 +502,7 @@ | |
$IMAGE_NAME:$VERSION-armv7 | ||
create_and_push_manifest_dev: | ||
name: Create and Push Docker Manifest | ||
name: Create and Push Docker Manifest (Development) | ||
runs-on: ubuntu-latest | ||
needs: build_other_branches | ||
steps: | ||
|
@@ -519,7 +518,14 @@ | |
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Create and Push Docker Manifest dev | ||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create and Push Docker Manifest dev to DockerHub | ||
run: | | ||
IMAGE_NAME="${{ secrets.DOCKER_USERNAME }}/${{ needs.build_other_branches.outputs.slug_lower }}" | ||
VERSION="${{ needs.build_other_branches.outputs.version }}" | ||
|
@@ -532,7 +538,7 @@ | |
$IMAGE_NAME:$VERSION-i386 \ | ||
$IMAGE_NAME:$VERSION-armv7 | ||
- name: Create and Push Docker Manifest version | ||
- name: Create and Push Docker Manifest version to DockerHub | ||
run: | | ||
IMAGE_NAME="${{ secrets.DOCKER_USERNAME }}/${{ needs.build_other_branches.outputs.slug_lower }}" | ||
VERSION="${{ needs.build_other_branches.outputs.version }}" | ||
|
@@ -545,6 +551,33 @@ | |
$IMAGE_NAME:$VERSION-i386 \ | ||
$IMAGE_NAME:$VERSION-armv7 | ||
- name: Create and Push Docker Manifest dev to GHCR | ||
run: | | ||
IMAGE_NAME="ghcr.io/${{ needs.build_other_branches.outputs.repository_owner_lower }}/${{ needs.build_other_branches.outputs.slug_lower }}" | ||
VERSION="${{ needs.build_other_branches.outputs.version }}" | ||
docker buildx imagetools create \ | ||
-t $IMAGE_NAME:DEV \ | ||
$IMAGE_NAME:$VERSION-amd64 \ | ||
$IMAGE_NAME:$VERSION-aarch64 \ | ||
$IMAGE_NAME:$VERSION-armhf \ | ||
$IMAGE_NAME:$VERSION-i386 \ | ||
$IMAGE_NAME:$VERSION-armv7 | ||
- name: Create and Push Docker Manifest version to GHCR | ||
run: | | ||
IMAGE_NAME="ghcr.io/${{ needs.build_other_branches.outputs.repository_owner_lower }}/${{ needs.build_other_branches.outputs.slug_lower }}" | ||
VERSION="${{ needs.build_other_branches.outputs.version }}" | ||
docker buildx imagetools create \ | ||
-t $IMAGE_NAME:$VERSION \ | ||
$IMAGE_NAME:$VERSION-amd64 \ | ||
$IMAGE_NAME:$VERSION-aarch64 \ | ||
$IMAGE_NAME:$VERSION-armhf \ | ||
$IMAGE_NAME:$VERSION-i386 \ | ||
$IMAGE_NAME:$VERSION-armv7 | ||
update_config_main_or_pr: | ||
runs-on: ubuntu-latest | ||
needs: build_main_or_pr | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters