👷 Update Deploy Script
This commit is contained in:
@@ -53,8 +53,8 @@ jobs:
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "::set-output name=environment::${environment}"
|
||||
echo "::set-output name=version::${version}"
|
||||
echo "environment=${environment}" >> "$GITHUB_OUTPUT"
|
||||
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
deploy:
|
||||
name: 👷 Build & Deploy ${{ matrix.architecture }}
|
||||
@@ -79,31 +79,32 @@ jobs:
|
||||
restore-keys: |
|
||||
docker-${{ matrix.architecture }}
|
||||
- name: 🏗 Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1.2.0
|
||||
uses: docker/setup-qemu-action@v2.1.0
|
||||
- name: 🏗 Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1.6.0
|
||||
uses: docker/setup-buildx-action@v2.4.1
|
||||
- name: ℹ️ Compose build flags
|
||||
id: flags
|
||||
run: |
|
||||
echo "::set-output name=date::$(date +"%Y-%m-%dT%H:%M:%SZ")"
|
||||
echo "date=$(date +"%Y-%m-%dT%H:%M:%SZ")" >> "$GITHUB_OUTPUT"
|
||||
from=$(yq --no-colors eval ".build_from.${{ matrix.architecture }}" "${{ needs.information.outputs.build }}")
|
||||
echo "::set-output name=from::${from}"
|
||||
echo "from=${from}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
if [[ "${{ matrix.architecture}}" = "amd64" ]]; then
|
||||
echo "::set-output name=platform::linux/amd64"
|
||||
echo "platform=linux/amd64" >> "$GITHUB_OUTPUT"
|
||||
elif [[ "${{ matrix.architecture }}" = "i386" ]]; then
|
||||
echo "::set-output name=platform::linux/386"
|
||||
echo "platform=linux/386" >> "$GITHUB_OUTPUT"
|
||||
elif [[ "${{ matrix.architecture }}" = "armhf" ]]; then
|
||||
echo "::set-output name=platform::linux/arm/v6"
|
||||
echo "platform=linux/arm/v6" >> "$GITHUB_OUTPUT"
|
||||
elif [[ "${{ matrix.architecture }}" = "armv7" ]]; then
|
||||
echo "::set-output name=platform::linux/arm/v7"
|
||||
echo "platform=linux/arm/v7" >> "$GITHUB_OUTPUT"
|
||||
elif [[ "${{ matrix.architecture }}" = "aarch64" ]]; then
|
||||
echo "::set-output name=platform::linux/arm64/v8"
|
||||
echo "platform=linux/arm64/v8" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "::error ::Could not determine platform for architecture ${{ matrix.architecture }}"
|
||||
exit 1
|
||||
fi
|
||||
- name: 🏗 Login to GitHub Container Registry
|
||||
uses: docker/login-action@v1.14.1
|
||||
uses: docker/login-action@v2.1.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
@@ -116,14 +117,14 @@ jobs:
|
||||
load: true
|
||||
# yamllint disable rule:line-length
|
||||
tags: |
|
||||
ghcr.io/gauthamvarmak/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}
|
||||
ghcr.io/gauthamvarmak/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}
|
||||
ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}
|
||||
ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}
|
||||
# yamllint enable rule:line-length
|
||||
context: ${{ needs.information.outputs.target }}
|
||||
file: ${{ needs.information.outputs.target }}/Dockerfile
|
||||
cache-from: |
|
||||
type=local,src=/tmp/.docker-cache
|
||||
ghcr.io/gauthamvarmak/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:edge
|
||||
ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:edge
|
||||
cache-to: type=local,mode=max,dest=/tmp/.docker-cache-new
|
||||
platforms: ${{ steps.flags.outputs.platform }}
|
||||
build-args: |
|
||||
@@ -147,9 +148,9 @@ jobs:
|
||||
# yamllint disable rule:line-length
|
||||
run: |
|
||||
docker push \
|
||||
"ghcr.io/gauthamvarmak/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}"
|
||||
"ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}"
|
||||
docker push \
|
||||
"ghcr.io/gauthamvarmak/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}"
|
||||
"ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}"
|
||||
|
||||
publish-stable:
|
||||
name: 📢 Publish to stable repository
|
||||
@@ -162,10 +163,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🚀 Dispatch repository updater update signal
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
uses: peter-evans/repository-dispatch@v2.1.1
|
||||
with:
|
||||
token: ${{ secrets.DISPATCH_TOKEN }}
|
||||
repository: GauthamVarmaK/hassio-addons
|
||||
repository: ghcr.io/${{ github.repository_owner }}/hassio-addons
|
||||
event-type: update
|
||||
client-payload: >
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user