This repository has been archived by the owner on Aug 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update docker-compose.yaml * Update Dockerfile * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update Dockerfile * Update Dockerfile * Update build-and-push-image.yml * Update build-and-push-image.yml * Update Dockerfile * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update Dockerfile * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update build-and-push-image.yml * Update Dockerfile * Update Dockerfile * Update docker-compose.yaml * moved to 2 different actions * change name * updated build and push
- Loading branch information
Showing
4 changed files
with
84 additions
and
29 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 |
---|---|---|
@@ -1,53 +1,36 @@ | ||
name: build-and-push-image | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' # Schedule to run once every day | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
CURRENT_RELEASE: v0.3.1 | ||
|
||
jobs: | ||
build-multi-arch-image: | ||
name: Build multi-arch Docker image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check for new release | ||
id: check_release | ||
run: | | ||
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/vishen/go-chromecast/releases/latest | jq -r '.tag_name') | ||
echo "release=$LATEST_RELEASE" >> $GITHUB_ENV | ||
echo "CURRENT_RELEASE=${{ steps.check_release.outputs.release }}" >> $GITHUB_ENV | ||
- name: Checkout | ||
if: steps.check_release.outputs.release != env.CURRENT_RELEASE | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
if: steps.check_release.outputs.release != env.CURRENT_RELEASE | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
uses: docker/[email protected] | ||
|
||
- name: Set up Docker Buildx | ||
if: steps.check_release.outputs.release != env.CURRENT_RELEASE | ||
uses: docker/setup-buildx-action@v1 | ||
uses: docker/[email protected] | ||
with: | ||
install: true | ||
|
||
- name: Login to GitHub Container Registry | ||
if: steps.check_release.outputs.release != env.CURRENT_RELEASE | ||
uses: docker/login-action@v1 | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
if: steps.check_release.outputs.release != env.CURRENT_RELEASE | ||
uses: docker/build-push-action@v2 | ||
uses: docker/[email protected] | ||
with: | ||
push: true | ||
push: true | ||
tags: ghcr.io/${{ github.repository }}:latest | ||
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6 |
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Check for new Go Chromecast version | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" # Schedule to run once every day | ||
|
||
jobs: | ||
build-multi-arch-image: | ||
name: Build multi-arch Docker image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get current go-chromecast version from Dockerfile | ||
id: get-current-version | ||
run: | | ||
CURRENT_CHROMECASTGOVERSION=$(grep -oP '(?<=CHROMECASTGOVERSION=).*' ./Dockerfile) | ||
echo "CURRENT_CHROMECASTGOVERSION=$CURRENT_CHROMECASTGOVERSION" >> $GITHUB_ENV | ||
- name: Get latest go-chromecast version | ||
id: get-latest-version | ||
run: | | ||
LATEST_VERSION=$(curl -s "https://api.github.com/repos/vishen/go-chromecast/releases/latest" | jq -r '.tag_name') | ||
echo "LATEST_CHROMECASTGOVERSION=$LATEST_VERSION" >> $GITHUB_ENV | ||
- name: Check if version is newer and update Dockerfile | ||
id: check-version-and-update-dockerfile | ||
run: | | ||
if [[ "${{ env.CURRENT_CHROMECASTGOVERSION }}" == "${{ env.LATEST_CHROMECASTGOVERSION }}" ]]; then | ||
echo "No new version available. Skipping Dockerfile update." | ||
echo "VERSION_CHANGED=false" >> $GITHUB_ENV | ||
else | ||
echo "New version available. Updating Dockerfile." | ||
echo "VERSION_CHANGED=true" >> $GITHUB_ENV | ||
sed -i "s/ENV CHROMECASTGOVERSION=.*/ENV CHROMECASTGOVERSION=${{ env.LATEST_CHROMECASTGOVERSION }}/" ./Dockerfile | ||
fi | ||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
if: ${{ env.VERSION_CHANGED == 'true' }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
with: | ||
install: true | ||
if: ${{ env.VERSION_CHANGED == 'true' }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
if: ${{ env.VERSION_CHANGED == 'true' }} | ||
|
||
- name: Build and push | ||
uses: docker/[email protected] | ||
with: | ||
push: true | ||
context: . | ||
tags: ghcr.io/${{ github.repository }}:latest | ||
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6 | ||
file: ./Dockerfile | ||
if: ${{ env.VERSION_CHANGED == 'true' }} |
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