From 618282375cc0d48109d9986f2fd1156a4f7cb15f Mon Sep 17 00:00:00 2001 From: JBB0807 <104856796+JBB0807@users.noreply.github.com> Date: Mon, 26 May 2025 13:01:06 -0700 Subject: [PATCH] added github actions --- .github/workflows/deploy.yml | 63 ++++++++++++++++++++++++++++++++ .github/workflows/fly-deploy.yml | 18 --------- 2 files changed, 63 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/fly-deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..eafa63e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,63 @@ +# Name of our overall action +name: Deploy to GitHub Pages + +# on defines when the action will run +on: + push: + branches: [main] + workflow_dispatch: +# permissions grant the image runner the ability to perform read/write files +permissions: + contents: read + pages: write + id-token: write + +# commits made to main at almost the same time will cancel the previous and only run the last +concurrency: + group: "pages" + cancel-in-progress: true + +# job defines WHAT actions(s) will run +jobs: + # build is the name of the job, can be any name + build: + #each job is executed in an image (ubuntu) + runs-on: ubuntu-22.04 + #step are task + steps: + #each step has a name, a command (like run) or uses a pre-made steps like pnpm/action-setup@v2 + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Instal pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false + #with are argument supplied to the actions + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "18" + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Build Application + run: pnpm build + - name: Upload Build Artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./dist + # artifact prepares the static files for GH Pages deployment and makes them available for the next job. + deploy: + environment: + #setting environment variables for this job + name: github-pages + url: ${{steps.deployment.outputs.page_url}} + #dependency on build, it will only run if build job completed successfully + needs: build + runs-on: ubuntu-22.04 + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + # no additional config required diff --git a/.github/workflows/fly-deploy.yml b/.github/workflows/fly-deploy.yml deleted file mode 100644 index b0c246e..0000000 --- a/.github/workflows/fly-deploy.yml +++ /dev/null @@ -1,18 +0,0 @@ -# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/ - -name: Fly Deploy -on: - push: - branches: - - main -jobs: - deploy: - name: Deploy app - runs-on: ubuntu-latest - concurrency: deploy-group # optional: ensure only one action runs at a time - steps: - - uses: actions/checkout@v4 - - uses: superfly/flyctl-actions/setup-flyctl@master - - run: flyctl deploy --remote-only - env: - FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}