docs: add deepwiki scraping shell script #7
This file contains hidden or 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: Docker Build and Push ghcr.io | |
on: | |
push: | |
branches: | |
- main | |
- release/* | |
jobs: | |
build-push: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
env: | |
REGISTRY: ghcr.io | |
REPOSITORY: ${{ github.repository }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Login to ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Determine image tag | |
id: determine_tag | |
run: | | |
BRANCH_NAME=${{ github.ref_name }} | |
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV | |
if [[ "$BRANCH_NAME" == "main" ]]; then | |
echo "TAG=latest" >> $GITHUB_ENV | |
elif [[ "$BRANCH_NAME" =~ ^release/v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then | |
echo "TAG=${BASH_REMATCH[1]}" >> $GITHUB_ENV | |
else | |
echo "Invalid branch name format for release (expected: release/vX.Y.Z)" | |
exit 1 | |
fi | |
- name: Build docker image | |
run: | | |
docker build \ | |
--tag app:latest \ | |
--build-arg UID=${{ env.UID }} \ | |
--build-arg USER=${{ env.USER }} \ | |
. | |
docker tag app:latest ${REGISTRY}/${REPOSITORY}:${TAG} | |
docker tag app:latest ${REGISTRY}/${REPOSITORY}:latest | |
- name: Push docker image | |
run: | | |
docker push ${REGISTRY}/${REPOSITORY}:${TAG} | |
docker push ${REGISTRY}/${REPOSITORY}:latest | |
- name: Clean up docker images | |
run: | | |
docker rmi -f app:latest | |
docker rmi -f ${REGISTRY}/${REPOSITORY}:${TAG} | |
docker rmi -f ${REGISTRY}/${REPOSITORY}:latest |