Serves artifact files from a configured Github repository.
Features include:
- Automatic content updates
- Atomic updates to files to eliminate downtime
- Provided webhook to manually trigger updates
- Build information available at
/.ArtifactServer/metadata.json- Last update, last check, errors
Rebuild your artifacts at least more often then the retention period you set in the upload-pages-artifact step.
on:
# Run at least every month to be safe
schedule:
- cron: "0 0 1 * *"Use upload-pages-artifact to upload the files you want to serve. https://github.com/actions/upload-pages-artifact
- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: <path to build output>
retention-days: 90Hit the webhook after artifact upload to toggle a reload of assets.
# Deployment job
deploy:
if: github.event_name != 'pull_request' && github.ref =='refs/heads/main'
runs-on: ubuntu-latest
needs: build
steps:
- name: Hit Web Hook
run: |
curl -X 'POST' \
'https://<site-root>/api/api/hooks/release-download-toggle' \
-H 'accept: application/json' \
-d ''Set the following environment variables in your images (NGINX and Webhook)
GITHUB_REPO=<repo_owner>/<repo_name> # e.g., CHTC/chtc-website-source
GITHUB_TOKEN=<>
docker build -t artifact-webhook .docker run -it -p 8080:8000 --env-file .env -v ${PWD}/srv:/srv artifact-webhookdocker build --platform linux/amd64 -t hub.opensciencegrid.org/opensciencegrid/artifact-webhook:latest .docker push hub.opensciencegrid.org/opensciencegrid/artifact-webhook:latestdocker run -it -p 80:80 -v ${PWD}/srv:/srv -v ${PWD}/nginx.conf:/etc/nginx/nginx.conf:ro nginx