Some checks failed
Build and Deploy ytdlp-site / build-deploy (push) Failing after 1m38s
61 lines
1.8 KiB
YAML
61 lines
1.8 KiB
YAML
name: Build and Deploy ytdlp-site
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
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: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
|
# run: |
|
|
# echo "${{ secrets.GHCR_TOKEN }}" | docker login git.carlpearson.net -u cwpearson --password-stdin
|
|
# docker push ${{ env.SLUG }}:latest
|
|
# docker push ${{ env.SLUG }}:${{ env.DATE }}
|
|
|
|
- name: Deploy to Container Registry
|
|
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
|
run: |
|
|
docker login git.carlpearson.net -u cwpearson
|
|
docker push ${{ env.SLUG }}:latest
|
|
docker push ${{ env.SLUG }}:${{ env.DATE }}
|