mirror of
https://github.com/darkzoul5/YoutubePlaylistSync.git
synced 2026-07-04 21:04:01 +03:00
Update Docker and workflow configurations for improved build process
This commit is contained in:
@@ -118,13 +118,52 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Get version
|
||||
id: version
|
||||
shell: bash
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.tag || inputs.tag }}"
|
||||
VERSION="${TAG#v}"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Download Linux Artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: linux-release
|
||||
- name: Build and Push Docker (Optional)
|
||||
path: dist/linux-docker
|
||||
|
||||
- name: Prepare Docker build context
|
||||
run: |
|
||||
echo "Placeholder for Docker build if needed"
|
||||
cd dist/linux-docker
|
||||
tar -xzf yt-playlist-linux-${{ steps.version.outputs.version }}.tar.gz
|
||||
cp ../../Dockerfile .
|
||||
cp ../../docker-entrypoint.sh .
|
||||
# Ensure ytpld package is present
|
||||
if [ ! -d "ytpld" ]; then cp -r ../../ytpld . ; fi
|
||||
|
||||
- name: Set docker image names
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
echo "RELEASE_IMAGE=ghcr.io/${GITHUB_ACTOR}/ytpld:${VERSION}" >> $GITHUB_ENV
|
||||
echo "LATEST_IMAGE=ghcr.io/${GITHUB_ACTOR}/ytpld:latest" >> $GITHUB_ENV
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build . -t $RELEASE_IMAGE -t $LATEST_IMAGE
|
||||
working-directory: dist/linux-docker
|
||||
|
||||
- name: Save Docker images
|
||||
run: |
|
||||
docker save -o docker-image.tar $RELEASE_IMAGE
|
||||
docker save -o docker-image-latest.tar $LATEST_IMAGE
|
||||
working-directory: dist/linux-docker
|
||||
|
||||
- name: Upload Docker artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: docker-images
|
||||
path: dist/linux-docker/docker-image*.tar
|
||||
|
||||
release:
|
||||
needs: [build, docker]
|
||||
@@ -133,6 +172,20 @@ jobs:
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Push Docker images
|
||||
run: |
|
||||
docker load -i docker-images/docker-image.tar
|
||||
docker push ghcr.io/${GITHUB_ACTOR}/ytpld:${{ steps.version.outputs.version }}
|
||||
docker load -i docker-images/docker-image-latest.tar
|
||||
docker push ghcr.io/${GITHUB_ACTOR}/ytpld:latest
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user