Workflow ill now Upload Artifacts #44
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: Autonomous deployment | ||
run-name: Website Deployment | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
# Testing the site configuration with astro check >> https://docs.astro.build/de/reference/cli-reference/#astro-check | ||
website-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Branch | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '19' | ||
cache: 'npm' | ||
- name: Installing Astro | ||
run: npm install astro | ||
- name: Testing Website | ||
run: npm run astro check | ||
# Build the website and cache it >> https://docs.astro.build/de/reference/cli-reference/#astro-build | ||
website-build: | ||
runs-on: ubuntu-latest | ||
needs: website-check | ||
steps: | ||
- name: Checkout Branch | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '19' | ||
cache: 'npm' | ||
- name: Installing Astro | ||
run: npm install astro | ||
- name: Building Website | ||
run: npm run build | ||
- name: Upload Build as Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: build | ||
path: ./dist | ||
# Deploy the Website (Won't do anything) | ||
# website-deployment: | ||
# runs-on: self-hosted | ||
# needs: website-build | ||
# steps: | ||
# - name: Remove old Site | ||
# run: cd dist && rm -rf $(pwd) | ||
# - name: Restore Website from Cache | ||
# uses: actions/cache/restore@v3 | ||
# env: | ||
# cache-name: website-build | ||
# with: | ||
# path: ./dist | ||
# key: build-cache-${{steps.get-date.outputs.date}} | ||
# - name: ls -l | ||
# run: cd dist && ls -l |