All checks were successful
Build and Deploy ytdlp-site / build-deploy (push) Successful in 8m38s
56 lines
1.6 KiB
YAML
56 lines
1.6 KiB
YAML
name: Build and Deploy ytdlp-site
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
schedule:
|
|
# Runs every Friday at 2:30 AM UTC
|
|
- cron: '30 2 * * 5'
|
|
env:
|
|
SLUG: git.carlpearson.net/cwpearson/ytdlp-site
|
|
TZ: America/Denver
|
|
|
|
jobs:
|
|
build-deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Print environment info
|
|
run: |
|
|
echo "Job ID: ${{ github.run_id }}"
|
|
echo "Job URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
echo "Build Submitter: ${{ github.actor }}"
|
|
echo "Build Reason: ${{ github.event_name }}"
|
|
echo "Git Ref: ${{ github.ref }}"
|
|
|
|
- name: Setup environment
|
|
run: |
|
|
echo "DATE=$(date +"%Y%m%d_%H%M")" >> $GITHUB_ENV
|
|
echo "GIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
|
|
|
- name: Install prerequisites
|
|
run: |
|
|
bash .ci/ubuntu_setup_docker.sh
|
|
|
|
- name: Build Docker image
|
|
run: |
|
|
docker build . \
|
|
--file Dockerfile \
|
|
--build-arg GIT_SHA=${{ env.GIT_SHA }} \
|
|
--tag ${{ env.SLUG }}:${{ env.DATE }} \
|
|
--tag ${{ env.SLUG }}:latest
|
|
|
|
- name: Deploy to Container Registry
|
|
if: gitea.ref == 'refs/heads/master' && gitea.event_name == 'push'
|
|
run: |
|
|
echo "${{ secrets.GIT_PASSWORD }}" | docker login git.carlpearson.net -u "${{ secrets.GIT_USERNAME }}" --password-stdin
|
|
docker push ${{ env.SLUG }}:latest
|
|
docker push ${{ env.SLUG }}:${{ env.DATE }}
|