Rebase on Ubuntu #10
Workflow file for this run
This file contains hidden or 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
| name: Build Image | |
| on: [push, pull_request, workflow_dispatch] | |
| env: | |
| ENDPOINT: "aptalca/viniplay" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/[email protected] | |
| - name: Versions | |
| run: | | |
| APP_VERSION=$(curl -sfX GET "https://api.github.com/repos/ardoviniandrea/ViniPlay/releases/latest" \ | |
| | jq -r '.tag_name') | |
| echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_ENV | |
| - name: Build image | |
| run: | | |
| docker build --no-cache --build-arg APP_VERSION=${APP_VERSION} -t ${{ github.sha }} . | |
| - name: Tag image | |
| if: ${{ github.ref == format('refs/heads/main') }} | |
| run: | | |
| docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${{ github.sha }} | |
| docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${APP_VERSION} | |
| docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:latest | |
| docker tag ${{ github.sha }} ${ENDPOINT}:${{ github.sha }} | |
| docker tag ${{ github.sha }} ${ENDPOINT}:${APP_VERSION} | |
| docker tag ${{ github.sha }} ${ENDPOINT}:latest | |
| - name: Login to GitHub Container Registry | |
| if: ${{ github.ref == format('refs/heads/main') }} | |
| run: | | |
| echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u aptalca --password-stdin | |
| - name: Push tags to GitHub Container Registry | |
| if: ${{ github.ref == format('refs/heads/main') }} | |
| run: | | |
| docker push ghcr.io/${ENDPOINT}:${{ github.sha }} | |
| docker push ghcr.io/${ENDPOINT}:${APP_VERSION} | |
| docker push ghcr.io/${ENDPOINT}:latest | |
| - name: Login to DockerHub | |
| if: ${{ github.ref == format('refs/heads/main') }} | |
| run: | | |
| echo ${{ secrets.DOCKERPASS }} | docker login -u aptalca --password-stdin | |
| - name: Push tags to DockerHub | |
| if: ${{ github.ref == format('refs/heads/main') }} | |
| run: | | |
| docker push ${ENDPOINT}:${{ github.sha }} | |
| docker push ${ENDPOINT}:${APP_VERSION} | |
| docker push ${ENDPOINT}:latest |