Skip to content

Building and Deployiing #10

Building and Deployiing

Building and Deployiing #10

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

View workflow run for this annotation

GitHub Actions / Build and Deploy Binq Static Web

Invalid workflow file

The workflow is not valid. .github/workflows/deploy-to-prod.yml (Line: 55, Col: 9): Unrecognized named-value: 'IS_MERGING_TO_MASTER'. Located at position 1 within expression: IS_MERGING_TO_MASTER .github/workflows/deploy-to-prod.yml (Line: 61, Col: 17): Unrecognized named-value: 'ARTIFACT_NAME'. Located at position 1 within expression: ARTIFACT_NAME
runs-on: ubuntu-latest
steps:
- run: Download Latest Artifact
- uses: actions/download-artifact@v4
with:
name: "artifact_${{ ARTIFACT_NAME }}"