chore: pnpm up -r --latest #370
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: Deploy Static App | |
on: | |
push: | |
branches: | |
- 'main' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
deploy_backend_image: | |
# run only when code is compiling and tests are passing | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# steps to perform in job | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# setup Docker buld action | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: create image from repository | |
run: docker build -t ghcr.io/${{ github.actor }}/plantarium-backend . -f apps/backend/Dockerfile | |
- name: push image to GitHub Container Registry | |
run: docker push ghcr.io/${{ github.actor }}/plantarium-backend:latest | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- name: 'Deploy to fly.io' | |
run: flyctl deploy --remote-only | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
deploy_gh_pages: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18.7.0' | |
- uses: pnpm/[email protected] | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 7 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- run: 'pnpm i && pnpm build' | |
env: | |
IS_GH_PAGES: true | |
VITE_API_URL: ${{ secrets.API_URL }} | |
- run: 'cp -r apps/admin/build apps/frontend/build/admin' | |
- run: 'cp -r packages/ui/build apps/frontend/build/ui' | |
- run: 'cp -r packages/nodesystem/build apps/frontend/build/nodes' | |
- run: 'cp -r packages/geometry/build apps/frontend/build/geometry' | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: ./apps/frontend/build | |
- name: Deploy 🚀 | |
uses: actions/deploy-pages@v3 |