Hide edit action bttns when guest #132
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: Build and Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21.1' | |
- name: Setup Node and NPM | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.14.0 | |
- name: Install NPM Packages | |
run: npm ci | |
- name: Compile Server | |
run: go build -ldflags="-s -w" | |
- name: Compile UI | |
run: npm run build:css && npm run build:brixi && npm run build:bundle && npm run build:js | |
- name: Load SSH Key | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- name: Deploy | |
run: rsync -azh --delete-after --exclude={'/.env','/node_modules','/.git','/.github','/build','/models','/scripts','/styles','.gitignore','brixi.config.js','cssmonster.config.json','go.mod','go.sum','package.json','package-lock.json','server.go','tsconfig.json'} -e "ssh -o StrictHostKeyChecking=no" ./ ${{ secrets.USERNAME }}@${{ secrets.HOST }}:~/server | |
- name: Post Deployment | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
USERNAME: ${{ secrets.USERNAME }} | |
PORT: 22 | |
KEY: ${{ secrets.SSH_KEY }} | |
script: systemctl restart divine-drop.service | |
- name: Purge cache | |
uses: nathanvaughn/actions-cloudflare-purge@master | |
if: success() | |
with: | |
cf_zone: ${{ secrets.CLOUDFLARE_ZONE }} | |
cf_auth: ${{ secrets.CLOUDFLARE_AUTH_KEY }} |