docker-nightly.sh 1.2 KB

1234567891011121314151617181920212223242526272829
  1. # Docker build
  2. # Must authenticate first: https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-to-github-packages
  3. DOCKER_IMAGE="owncast"
  4. DATE=$(date +"%Y%m%d")
  5. VERSION="${DATE}-nightly"
  6. GIT_COMMIT=$(git rev-list -1 HEAD)
  7. # Create production build of Tailwind CSS
  8. pushd ../../build/javascript >> /dev/null
  9. # Install the tailwind & postcss CLIs
  10. npm install --quiet --no-progress
  11. # Run the tailwind CLI and pipe it to postcss for minification.
  12. # Save it to a temp directory that we will reference below.
  13. NODE_ENV="production" ./node_modules/.bin/tailwind build | ./node_modules/.bin/postcss > "../../webroot/js/web_modules/tailwindcss/dist/tailwind.min.css"
  14. popd
  15. echo "Building Docker image ${DOCKER_IMAGE}..."
  16. # Change to the root directory of the repository
  17. cd $(git rev-parse --show-toplevel)
  18. # Docker build
  19. docker build --build-arg NAME=docker --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=$GIT_COMMIT -t ghcr.io/owncast/${DOCKER_IMAGE}:nightly .
  20. # Dockerhub
  21. # You must be authenticated via `docker login` with your Dockerhub credentials first.
  22. # docker push gabekangas/owncast:nightly
  23. docker push ghcr.io/owncast/${DOCKER_IMAGE}:nightly