Merge pull request #12 from kujtimprenku/dependabot/npm_and_yarn/vite… #28
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: Deployment via Custom Action | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get code | |
uses: actions/checkout@v3 | |
- name: Load & cache dependencies | |
id: cache-deps | |
uses: ./.github/actions/cached-deps | |
with: | |
caching: 'false' | |
- name: Output information | |
run: echo "Cache used? ${{ steps.cache-deps.outputs.used-cache }}" | |
- name: Lint code | |
run: echo "Linting..." | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get code | |
uses: actions/checkout@v3 | |
- name: Load & cache dependencies | |
uses: ./.github/actions/cached-deps | |
- name: Test code | |
id: run-tests | |
run: npm run test | |
- name: Upload test report | |
if: failure() && steps.run-tests.outcome == 'failure' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-report | |
path: test.json | |
build: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get code | |
uses: actions/checkout@v3 | |
- name: Load & cache dependencies | |
uses: ./.github/actions/cached-deps | |
- name: Build website | |
run: npm run build | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist-files | |
path: dist | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get code | |
uses: actions/checkout@v3 | |
- name: Get build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist-files | |
path: ./dist | |
- name: Output contents | |
run: ls | |
- name: Deploy site | |
id: deploy | |
uses: ./.github/actions/deploy-s3-javascript | |
# uses: ./.github/actions/deploy-s3-docker | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
with: | |
bucket: gha-custom-action-hosting | |
dist-folder: ./dist | |
# bucket-region: us-east-2 | |
- name: Output information | |
run: | | |
echo "Live URL: ${{ steps.deploy.outputs.website-url }}" |