Build youtube-dl image #493
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
name: Build youtube-dl image | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: '0 12 * * 2,5' | |
env: | |
IMAGE_NAME: docker-youtube-dl | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Log into registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin | |
- name: Build image | |
run: docker build . --file Dockerfile --tag image | |
- name: Push image | |
run: | | |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME | |
VERSION=$(date "+%Y.%m.%d") | |
echo IMAGE_ID=$IMAGE_ID | |
echo VERSION=$VERSION | |
docker tag image $IMAGE_ID:$VERSION | |
docker push $IMAGE_ID:$VERSION | |
docker tag $IMAGE_ID:$VERSION $IMAGE_ID:latest | |
docker push $IMAGE_ID:latest |