This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
Publish #15459
This file contains 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: Publish | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 * * * *' # every hour | |
workflow_dispatch: { } | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '16' | |
- run: npm install | |
- run: make | |
- name: Publish | |
shell: bash | |
run: | | |
mkdir -p ~/.kube | |
echo "${{secrets.KUBECONFIG}}" > ~/.kube/config | |
POD=$(kubectl -n embassy get po -l app=website -o jsonpath={.items[0].metadata.name}) | |
mv build/site build/book | |
tar -C build -cf book.tar book | |
kubectl exec $POD -- mkdir -p /usr/share/nginx/html | |
kubectl cp book.tar $POD:/usr/share/nginx/html/ | |
kubectl exec $POD -- find /usr/share/nginx/html | |
kubectl exec $POD -- tar -C /usr/share/nginx/html -xvf /usr/share/nginx/html/book.tar |