Building and Deployiing #10
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: Build and Deploy Binq Static Web | ||
run-name: Building and Deployiing | ||
on: | ||
pull_request: | ||
branches: | ||
- "dev" | ||
- "master" | ||
- "!feature-**/" | ||
jobs: | ||
job_1_build: | ||
name: Build and Upload Production Artifact | ||
env: | ||
NODE_VERSION: "20.10.0" | ||
ARTIFACT_RETENTION_DAYS: "90" | ||
REPO_UPDATED_TIMESTAMP: github.event.repository.updated_at | sed 's/:/-/g' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
artifact_name: "artifact_$REPO_UPDATED_TIMESTAMP" | ||
steps: | ||
- run: echo "Attempting to install required tools and build project" | ||
- uses: actions/checkout@v4 | ||
- name: "Use Node.js $NODE_VERSION" | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "$NODE_VERSION" | ||
cache: "npm" | ||
- name: Install Dependencies and Build project | ||
run: | | ||
npm ci | ||
npx tailwindcss build -i ./src/input.css -o ./src/output.css --minify | ||
npm run build --f-present | ||
- name: Store production artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: "artifact_$REPO_UPDATED_TIMESTAMP" | ||
path: | | ||
dist | ||
!dist/**/*.md | ||
retention-days: "$ARTIFACT_RETENTION_DAYS" | ||
- run: echo "🍏 Build and save artifact status is ${{ job.status }}." | ||
job_2_deploy: | ||
name: Attempt to Deploy Project | ||
env: | ||
IS_MERGING_TO_MASTER: github.ref == 'refs/heads/master' | ||
HAS_PR_MERGING: github.event.pull_request.merged | ||
ARTIFACT_NAME: ${{ needs.job_1_build.outputs.artifact_name }} | ||
if: ${{ IS_MERGING_TO_MASTER }} && ${{ HAS_PR_MERGING }} | ||
Check failure on line 55 in .github/workflows/deploy-to-prod.yml GitHub Actions / Build and Deploy Binq Static WebInvalid workflow file
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- run: Download Latest Artifact | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: "artifact_${{ ARTIFACT_NAME }}" |